On an inbound web service action, you can use filtering. This topic explains how to apply filtering to get specific sales orders based on the sales order number or delivery date.
As an example, the filtering is set up for an inbound web service action of type REST.
Response message
Set up a message to use as response message on the web service action. The message gets the sales order from D365 FO, and has at least a mapping for SalesId and DeliveryDate:
Web service action
Set up an inbound web service action to get the sales orders using the web service access type REST.
For the inbound web service action, set up a SalesId argument and a DeliveryDate argument. For both arguments, make sure the:
- Range type is 'Parameter'.
- Style is 'QUERY'.
Filtering
To define the filtering to be applied, you are advised to use the Test function for the inbound web service action. The filtering must be related to the defined arguments. The test function helps you to directly see the result of the defined argument filtering.
First, set up the web service user and link the web service action to the web service user:
To define the desired filtering, on the Web service action page, on the Action pane, on the Development tab, click Test.
On the test page, define the:
- Web service user to validate if the user can access the web service.
- Desired filtering in the Resource URL. The default URL is defined by the web service action setup. To define the desired filtering, in the URL, for the desired argument ('SalesId' or 'DeliveryDate'), replace 'Your Value' with the desired value filtering.
In the resource URL, you can use this syntax to apply filtering:
Filter syntax |
Description |
[eq]YourValue |
The response message applies to a specific value. |
[lt]YourValue |
The response message applies to all value less than the defined value. |
[lte]YourValue |
The response message applies to all value less than or equal to the defined value. |
[gt]YourValue |
The response message applies to all value greater than the defined value. |
[gte]YourValue |
The response message applies to all value greater than or equal to the defined value. |
[in]YourValue1, YourValue2, YourValue3 |
The response message applies to all the defined values. |
[between]YourFromValue..YourToValue |
The response message applies to all values in the defined range of values. |
[startswith]YourValue |
The response message applies to all values that start with the defined value.
Note: This syntax can be applied only to string values. |
[endswith]Yourvalue |
The response message applies to all values that end with the defined value.
Note: This syntax can be applied only to string values. |
[contains]YourValue |
The response message applies to all values that contain the defined value.
Note: This syntax can be applied only to string values. |
Note: This filtering syntax is applicable only to inbound web service actions of type REST.
When you have defined the desired argument filtering, click Run. You can review the results in the Result section.
Sales order range
Examples of ranges you can use to filter the sales orders on sales order number are:
- Specific sales order: [Your URL]/biswebservice/rest/[Project]/[WebServiceAction]?SalesId=[eq]SLS000001
- Sales orders that start with a specific value: [Your URL]/biswebservice/rest/[Project]/[WebServiceAction]?SalesId=[startswith]SLS3
Delivery date range
Examples of ranges you can use to filter the sales orders on delivery date are:
- Range of delivery dates: [Your URL]/biswebservice/rest/[Project]/[WebServiceAction]?DeliveryDate=[between]03/15/2025..04/15/2025
- All sales orders with a delivery date from a specific delivery date: [Your URL]/biswebservice/rest/[Project]/[WebServiceAction]?DeliveryDate=[gte]01/07/2025
Note:
Make sure to use the right syntax for date values and datetime values. This must be in line with the format as used in your D365 FO environment. For example, if in D365 FO, for dates, the 'mm/dd/yyyy' format is used, apply this format to filter on dates.
URL
When the URL with the defined argument gives the desired results, you can copy the URL from the Test page and communicate it to the external application. So, they can use it to call the inbound web service to get the requested data.