0

I am using the CRM WEB API 2016 v8.1.

I need to filter data based on annotaion property like this one _objectid_value@Microsoft.Dynamics.CRM.lookuplogicalname

Anyone know how to do that or if it is implemented or not?

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
M.Abulsoud
  • 989
  • 7
  • 23

1 Answers1

1

If i understand you correctly you want to filter data from (for example) a lookup field in a record.

It is possible to filter with a single record. Example:

GET [Organization URI]/api/data/v8.2/accounts(00000000-0000-0000-0000-000000000001)?$expand=Account_Tasks($filter=endswith(subject,'1');$select=subject)

But it look like it's not yet possible to filter multiple record using $expand enter image description here

source: https://msdn.microsoft.com/en-us/library/mt607871.aspx?f=255&MSPPError=-2147217396#bkmk_optionsOnExpand

Skaj
  • 141
  • 6
  • I I got the following error message":"The string 'Microsoft.Dynamics.CRM.lookuplogicalname'contacts'' is not a valid enumeration type constant. when request www.example.com/api/data/v8.1/audits?$filter=_objectid_value eq Microsoft.Dynamics.CRM.lookuplogicalname'contacts' – M.Abulsoud Nov 16 '16 at 06:25
  • I need to filter on multiple result, like audits entity collection where _objectid_value@Microsoft.Dynamics.CRM.lookuplogicalname = 'contacts' – M.Abulsoud Nov 16 '16 at 12:20
  • The only way I know how to do that, is to get the audits using the "Prefer: odata.include-annotations="Microsoft.Dynamics.CRM.lookuplogicalname"" header. – Skaj Nov 18 '16 at 11:11
  • But the filter can only be done after you get the json object – Skaj Nov 18 '16 at 11:14
  • I think it's not implemented – M.Abulsoud Nov 18 '16 at 13:17