Item Tracking Problem

sanjeev_baranwalsanjeev_baranwal Member Posts: 101
Hi,
I have an issue regardng Item Tracking. I have certain lines from a new table to post. While posting (through new Codeunit) I am using COMMIT after creating the Reservation Entry. Everything is going fine. But when any problem comes in any one of the lines then some of the lines gets posted and others not. My requirement is to post all the lines at once. Please suggest how to proceed on this. Thanks in Advance.

Comments

  • philippegirodphilippegirod Member Posts: 191
    If the commit is really necessary in your Codeunit, you must be able to do like when Navision posts, to do that you can:

    1/ Copy the source tables in a temp table
    2/ Make all the changes in the copies (temp table)
    3/ If everything is fine, copy the temp table to the real tables

    If a mistake occurs during the process, the temp table simply disapear and your database is in the same status as if nothing happened.
    My candle burns by both ends, it will not last the night,
    But oh my foes and oh my friends, it gives a lovely light
  • arindomarindom Member Posts: 52
    according to "philippegirod" u can do and also care that before call the posting codunit u check all the validation for all line after check all lines validation u just post .
  • kinekine Member Posts: 12,562
    And best solution is not to use COMMIT... :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • sanjeev_baranwalsanjeev_baranwal Member Posts: 101
    Thanks I used the Temporary tables and it worked fine.
Sign In or Register to comment.