Post batch - error check

hey Folks,

here is a deal , I want to run post batch sales orders and ensure that it will run trough all the range or it will tell prior to the user what will fail for what reason.

However I have no clean solution for this . I am looking for a solution to :

  • Post everyting in test mode or all together and eventually roll back
  • Capture all errors for each documents
  • Provide list of potential issues to customer
  • Ensure that this solution will cater for future code changes in future (i.e. changes in cu 80 )

Any thoughts on this ?

thanks,

Gabor

Why? Just go through and post what you can and then lit out the ones that couldn’t post with the error message.

The only logical reason to want Batch posting is for performance, but Posting once, roll back then post again means that posting will take more than double the time, so will slow the system down, not speed it up.

Hi Gabor,

not easy… especially telling the user what went wrong is not easy. The problem is:

  • a testfield / error in the normal CU80/CU12/CU11 code ends the execution of this CU/context.

  • there can be more than one problem with this.

NAV2013 has a background posting facility, recording the first fatal error of the batch. Maybe having a look at the NAV2013 beta would be a good idea.

“My” solution would be:

  • a codeunit checking the basic conditions to get a clean post, more or less CU11, but written in a way to record all mismatches / error conditions in a list for the user. This is not customization-proof, you would have to make the change in the posting CU and in the checking CU separately.

  • trying to catch the rerror messages to show to the user. This would involve a webservice and / or fiddling around with the getlasterror() function.

  • maybe using the automated testing feature is worth a try. There are calls like assert() which could make sense to collect the mismatches.

with best regards, HTH

Jens

The user does already use batch posting it makes things easier if you post more than one order.

Problem is that they dont know which ones didnt go trough for what reason…

speed comes from productivity not cpu time.

g.

If they are batch posting - they must be using a range or filter. so how can they not know which ones didn’t post?

I would batch post. Whatever didn;t post, try to post them individually.

Make notes & a list of any error(s) that is causing it not to post.

then address those issues before posting.