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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s