Posting mod not working as expected

bhalpinbhalpin Member Posts: 309
Hi.

(This is NAV 4 on local (C/Side) database. Will be implemented in database on NAV server.)

I am doing a mod to sales orders & posting. When the user enters a sales line posting to a G/L account, and then posts, I am 'sneaking in' and adding addional Sales Line records that hae to be posted along with the G/L line. (Long story, but that's the situation.)

In CU 80 Sales-Post, at the top of OnRun() I call a custom function that figurers out and creates the sales line(s), sets up dimension records, etc. When it returns, OnRun() posts the lines beautifully. All is well.

But, one little problem remains: If posting the Sales Order fails for any user-related reason (missing dimension value, missing tax code, missing external doc no.) and posting aborts with the usual error message, then the new lines I created now appear on the sales order sub-form.

I was hoping that Sales-Post was an 'atomic' operation whereby all database changes are rolled back (including removing my new sales line) if something goes wrong - it seems to work that way everywhere else. But that doesn't seem to be the case here. :-k

Any thoughts, or pointers to what I should study up on?

Thanks!

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    There is a commit in CU80 after it gets the next invoice number. You are going to have to put your code after the commit.
    David Singleton
  • bhalpinbhalpin Member Posts: 309
    Ahhh a COMMIT ... shoulda looked for it. Thanks.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    You're welcome. :D
    David Singleton
Sign In or Register to comment.