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$filter=SalesOrderLineStatus eq Microsoft.Dynamics.DataEntities.SalesStatus'Invoiced'


Data entity name –  SalesOrderLines

field name – SalesOrderLineStatus

Enum name – SalesStatus

Referenced enum value – Invoiced


SalesTable Totals discount amount etc

This functionality help to find TotalAmount TaxAmount DiscountAmount and etc from salesTable. I won’t be copying the code here, but I will be linking the blog post where I found that infromation