sort problem : print sales invoices by batch

We print our sales invoices by batch (accounts receivables > periodic > sales updates > invoices) but it seems that ax alsways sort it by sales order.

We can change the view of the selected invoices by sorting but when they are printed the sales invoices our made starting from a lower sales order to a higher salesorder.

Could I change somewhere a parameter that AX print the invoices starting from a lower customer account number to an higher customer account number.

We do not want to use the possibility to summarize our invoices.

Thanks for your response


there is no parameter to achieve this I am afraid as far as I know, you would need to customise it.

Why do you change it?

In Accounts Receivable > Setup > Forms > Form Sorting > Invoice tab select to sort by Customer Account. Then when you run your Invoice batch job, change the Print field from Current to After. This way it posts, then sorts and prints.

Excellent, I tested this with with two orders loaded where the second order was a lower customer number and it invoiced the second order first. It must have been the “Print field” impact I missed - After. Michelle do you have an explanation for the print field, nothing in the help!

Its not actually posting the invoice for the second order first. It is just printing it first. Basically when set at “Current”, it posts the invoice then prints, then posts and prints. Where as “After” posts every thing first, then prints everything. Even the old 3.0 version had this.

HI Michelle,

Thanks for the information but if we do exactly the same it still prints the old-fashioned way (by salesorder). We sent our invoices by batch to Bottomline software wich generates a better layout than axapta. We have looked also in Bottomline, but there is no sorting rule mentionned.


Hi Kurt

You need to check again and verify no modifications, bucause the print works fine in the simple test I performed on the given settings. Try not sending them and printing to screen - what happens then, because your output maybe causing hte issue.

Hi Kurt,

i use AX 2012 when I tried to invoice sales order in batch, then I got the error, something like multiple threads batch (cannot remember exactly), do you have this experience?

what can I do ?

Hope hear from you soon!

have a nice day!


Hi rosa,

Sorry, but as we are just started testing our upgrade from AX2009 into AX2012 I do not have experience in invoicing sales order by batch.

We do not invoice by batch but by sales order. In AX2009 we had the “problem” that we print our invoices (after they are posted) into batch and it would be easier to sort them by customer. But despites all the information it didn’t work.




This sorting doesn’t work, I would want to have it in salerorder (with linenum)

but not even this is the case (don’t know what it is sorting on).

Do I need to post the multiple invoice in order for it to work?

If I untick Post (which I am trying on) the print option print with After choice

will be unavailable and I only get Current.

I use Select (latest query) and delete some sales orders before printing (to Bottomline).



It seems like it is sorting on LineNum.

It takes the first SO with item line 1, second SO with item line 1,

first SO with item line 2, second SO with item line 2 aso.

No matter what I choose in the form sorting (posting or not)

this order will not change.

I am running AX 2012.

Does anyone know how to solve this or it is a MS bug?



Hi Fredrik,

What are you trying to achieve? The posts in this thread refer to ‘Form sorting’ functionality, which can be used to determine the order in which invoices are printed if multiple invoices are posted at one time.


The XML-file that is generated from this process (there are 3 sales orders selected in the AX dialog)

is in the wrong order and I want to re-sort it.


Hi Fredrik,

So you have three sales orders on the invoice posting form. Are they for different invoice accounts?

If you go to Accounts receivable → Setup → Forms → Form sorting → Invoice tab, add ‘Sales order’ to the ‘Selected’ tab. Then, when you post the invoices, Tick ‘Posting’ and ‘Print invoice’ and set ‘Print’ to ‘After’.

Hi Guy,

It is the same customer account and invoice account.

I have tried this form sorting on sales orders, but there is no difference.

I don’t post the invoices, just do a preview.

I have tried however to post it, but there was no difference in the sort order.