English 中文(简体)
Dynamics Nav (Navision) webservice ReadMultiple date filter
原标题:

Using the Navision webservices, how can you filter by a date.

i.e. Within a SalesHeader table there is an "ExportedDate". I would like to find all SalesHeaders where the ExportedDate has not been set or were exported on a particular date.

It seems that whenever we set a filter on a date field, then the webservice will either return all rows or no rows.

问题回答

This can be done. You have to use the same filter expression as you would use in the Nav Client:

01012011..         would be all dates from 01.01.2011
..01012011         would be all dates to 01.01.2011
01012011..03012011 gets all dates between 01. and 03.

After publishing page 42 (Sales Order) as a web service in NAV, I added a web reference to the newly created web service in my Visual Studio project. In the C# code, I create a new instance of the service, and tell it to use the default credentials:

SalesOrders_Service salesOrdersService = new SalesOrders_Service();
salesOrdersService.UseDefaultCredentials = true;

Then I instantiate a filter, and set the field and criteria:

SalesOrders_Filter filter = new SalesOrders_Filter();
filter.Field = SalesOrders_Fields.Document_Date;
filter.Criteria = "01-31-14|  "; // specific date (MM-dd-yy) or empty

The filter instance is then added to a new array of SalesOrders_Filters before passing the latter to ReadMultiple:

SalesOrders[] salesOrders = salesOrdersService.ReadMultiple(new SalesOrders_Filter[] { filter }, null, 0);

On my machine, this returns two orders whose Document Date is 31 January 2014, and one order with a blank Document Date.





相关问题
Powder Physics Games

Does anyone have any experience with this sort of thing? I m talking about applets like this http://dan-ball.jp/en/javagame/dust/ I m really interested in how they work, it seems more like fluid-...

Discovering Dynamics SL (Solomon) Customizations

I m in the midst of upgrading a MS Dynamics SL (6.5sp1) installation, and was wondering if there was an easy way to review the BSL/VBA code involved in screen customizations. Or at least a way to ...

Competitive Learning in Neural Networks

I am playing with some neural network simulations. I d like to get two neural networks sharing the input and output nodes (with other nodes being distinct and part of two different routes) to compete. ...

Microsoft Dynamics CRM 4.0 and Identity Lifecycle Management

Customers are stored in Dynamics CRM 4.0 an some need access to external facing application and therefore should be provisioned in the DMZ Active Directory. Does it make sense to use MS Identity ...

热门标签