Batch Post Sales Orders

Hi there. I’m trying to experiment with report 296 in our test environment - batch posting of sales orders. I’ve created an Order, and done the Ship posting the standard manual method. I’ve gone into batch posting, supplied no filtering, which should from what I have read attempt to do all orders, and I selected the ‘Invoice’ option from the options screen.

When I select “ok”, I get the message “0 orders out of a total of 0 have now been posted.”.

I re-ran it, but supplied only the Order I just created, same result. I went to the order and was able to post as invoiced manually without any issues.

Any thoughts on where I’m going wrong?

thanks, Mark

Hi Mark,

Three possibilities off the top of my head

  1. A problem is a posting date

  2. an record in the approval template table 464

  3. Filters set on the sales header

Hope this helps

Thanks for your reply.

  1. With the posting date, I have entered the same date that exists on the Sales Order. Is that what you meant by a problem?

  2. On the approval templates table, the only one enabled is ‘S-QUOTE’ and thats on document type ‘quote’.

  3. By filter, do you mean one set through the application as an end user, or filtering in the code of the batch report?

thanks again, Mark

As a test select on options tab

Ship & Invoice = CHECK
Posting Date = ‘T’
Replace Posting Date = CHECK
Replace Document Date = CHECK
Calc Inv Discount = CHECK

Hi. Thanks for helping me out. I’ve tried as you said above, however I am still getting 0 out of 0 error. I took screen shots of the screen before I pressed Ok but I can’t see how to upload them.

I assume you are using the NA database. You could have an issue with the Sales Tax dates. There could be an issue with recalculating dates.

If you want you can just modify the report to stop at error messages, just call the posting routine with out the IF.

Hi there

What do you mean when you say NA database?

What should I look for with the Sales Tax Dates?


Hi everyone.

I’ve been able to work out what was happening. I ran a SQL trace and noticed it was looking for a status=1 on the header. I traced this back to the if statement in the approval setup. The only approval setup here was for Quotes, however it seams its presence was causing it to look for released orders only.

Commenting out the approval code or turning off the approval in approval templates solved the issue.

I’m interested to know why though - as the approval has type ‘quote’, not ‘order’. Any thoughts on that would be apprecieted.

North America, USA and Canada and in some versions Mexico.

There can be issues where you have sales tax rates that change. Say the rate is different between the data you first released the order and the date you ship the goods, NAV has to reopen and re-release to update tax. You may have some customization that gives an error when you re-release.

Anyway, what I always do is change the following

//>> Select to see error message or not

// Create PostOK::Boolean

//IF SalesPost.RUN(“Sales Header”) THEN BEGIN

// CounterOK := CounterOK + 1;

if ShowError then begin

SalesPost.RUN(“Sales Header”);

PostOK := true;

end else begin

postok := SalesPost.RUN(“Sales Header”);



CounterOK := CounterOK + 1;


Add PostOK to the request window, and if you tick it then the routine will stop at the first error instead of continuing. This way you can see what the error is.

//>> Select to see error message or not// Create PostOK::Boolean//IF SalesPost.RUN(“Sales Header”) THEN BEGIN// CounterOK := CounterOK + 1;if ShowError then begin SalesPost.RUN(“Sales Header”); PostOK := true;end else begin postok := SalesPost.RUN(“Sales Header”);end;IF postOK THEN BEGIN CounterOK := CounterOK + 1;//<<

I like the option of being able to stop on an error. I will definately be putting that code in. Thanks so much for your help.