Filter odata by enum in the URL

So apparently you cannot use simple string filter to filter odata by enum. You have to reference the enum that you are using in the URL.

For example if you want to filter salesLine data entity by SalesLineStatus field with value invoiced, you have to do the following

https://365DFOP.cloudax.dynamics.com/data/SalesOrderLines?$filter=SalesOrderLineStatus eq Microsoft.Dynamics.DataEntities.SalesStatus'Invoiced'

where

Data entity name –  SalesOrderLines

field name – SalesOrderLineStatus

Enum name – SalesStatus

Referenced enum value – Invoiced

Advertisements