Question

We are facing the following sorting issue during invoice posting in Dynamics AX 2009. Application version is given below.

Dynamics AX 2009 with Service Pack 1 and Roll Up 5 installed. Version: 5.0.1500.2985 (Both Kernel and Application)

Following are the steps that our users are performing:

  1. Navigated to Accounts receivable --> Periodic --> Sales update --> Invoice
  2. On the Posting invoice form, clicked on the select button.
  3. On the Sales update dialog, clicked on the Sorting tab.
  4. Changed the search direction of field Sales order to Descending.
  5. Deleted the Order lines - Line No - Ascending row from sorting.
  6. Clicked Ok to exit Sales update dialog.

After the data is retrieved, I see the Sales orders listed in the Posting invoice form's Overview tab in ascending order.

We don't have any sorting parameters set up in Accounts receivable --> Setup --> Forms --> Form sorting --> Invoice. So, I don't think that is the problem.

I was also able to simulate this scenario in the standard code that didn't have any customizations.

I would like to know if anyone has a solution to fix this problem.

Thanks in advance.

UPDATE:

I just found out from Microsoft Support that the Posting Invoice form is working as per design. So, I have to make a change in order for the form to function the way our users would like it to work. If I can find a solution, I will post it here.

To add more to the question, same thing happens in the Purchase Order Posting form as well.

Was it helpful?

Solution

Naturally users can change the sorting whenever needed by simply clicking the Sales order header in the grid, however if the default sorting needs to be changed the following can be done.

Open method \Forms\SalesEditLines\Methods\init. After the following line:

salesParmTable_ds.query().dataSourceTable(tablenum(SalesParmTable)).addRange(fieldnum(SalesParmTable, ParmId)).value(queryValue(parmId));

add a new one:

salesParmTable_ds.query().dataSourceTable(tablenum(SalesParmTable)).addSortField(fieldnum(SalesParmTable, SalesId), SortOrder::Descending);

NB: the default sorting will be changed for all processes that use this form e.g. Picking list, Delivery note, etc.

OTHER TIPS

Disregard the order of the records in the "Posting invoice" form - the invoices will be posted in the order specified by your sorting parameters, that is the Sales order with the greatest sales order number will be invoiced first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top