delegateas / XrmDefinitelyTyped

Tool to generate TypeScript declaration files for Dynamics 365/CDS client-side coding.
http://delegateas.github.io/Delegate.XrmDefinitelyTyped/
MIT License
133 stars 53 forks source link

Extend XrmQuery to implement Query Functions #79

Closed TomMalow closed 5 years ago

TomMalow commented 6 years ago

Dynamics 365 9.0 have introduced Query Functions that extends the Web API with functions to help create more complex queries. These function are equal to some of the operators found in view filters.

The new queries implements functions such as In and NotIn which previously required multiple calls. Other functions were possible but could reduce the size of the filter. Such as: -EqualBusinessId -EqualUserId -Today (date) -On (date) -NextXDays (date) -InFiscalYear (date) -Under (hierarchy) -Above (hierarchy)

An example of how the In functions is emplemented the following way:

?$filter=Microsoft.Dynamics.CRM.In(PropertyName='atttributeName',PropertyValues=['value','value'])

Each function needs to be handled separately. I suggest that the function that provides most value to XDT are prioritized first. As mentioned, some of these function can be created already with normal filtering.

magesoe commented 5 years ago

Added in version 4.2.0