i've been finding various places in Navision cusomization code where COMMIT is used to see in one record variable Rec1 changes previously made in another record of the same table Rec2:
Rec2.MODIFY
COMMIT
Rec1.GET
I wonder should not SELECTLATESTVERSION be used instead of COMMIT in such cases? Will it work correctly both in Native and MS SQL databases ?
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Besides, right after you do Rec2.MODIFY, it should be available in Rec1, so that code should work without the COMMIT.
RIS Plus, LLC
I have a codeunit that populates the sales header and lines, after inserting (two headers) it then posts (using sales-post cu81) them one after the other.
If the first one posts successfully and then the second one does not post, the first one should be rolled back. how do i achieve this? i am thinking of using commit like so:
You need to add some "flag" which is used in CU80 to skip the COMMIT at the end of the processing. And there is another commit during "releasing" the order - you need to assing posting nos. manually and "release" the order if you need to skip this commit... - but you need to "skip" the commit only in your specific case, not in common posting etc.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.