In Attain 3.01 you can find this section of code : IF Status = Status::Open THEN BEGIN CODEUNIT.RUN(CODEUNIT::“Release Sales Document”,SalesHeader); Status := Status::Open; MODIFY; COMMIT; Status := Status::Released; END; in Codeunit 80. Am I the only one finding this code a bit odd … ###### email@example.comEdited by - Tarek Demiati on 2001 Nov 20 10:12:39
Dear Tarek, that is NOT so odd as you think. Look at CODEUNIT::“Release Sales Document” and think about ‘roll back’. Got it? If not, solution tomorrow…
Hi Tarek - I have to agree with you on that one. I am currently working on a AD implementation in the US. And I have seen a lot of commits. What Walter is saying is correct also. But I would have to ask, why is it nessesary to modify the Sales header Table WHILE posting - And even more - Why COMMIT all of a sudden? //Henrik Helgesen -: KISS::Keep it Simple, Stupid :-
I think I am also missing something here. Rollback works also without the commit, right? Reijer.
Also, In Codeunit 414 (Release Sales Document) They do a get on the Sales Header : GET(“Document Type”,“No.”); Why do they do that ? Who can enlighten me on that one. (By the way if you comment out the GET line your document still get released automatically and posted) Is there any major changes in Attain in how comitting and rolling back used to be handled previously (NF 1.XX - NF 2.XX) IE : If an error is thrown while in the middle of your codeunit Navision will roll back all transactions (unless COMMIT is used) [b][h6] tare Edited by - Tarek Demiati on 2001 Nov 21 04:21:42
I know why they do a GET of the Sale Header: GET(“Document Type”,“No.”); In Codeunit 414, that’s because if you do not do so you get the error “Another user has modified Sales Header table …” This error occur only if you’re running SQL Server, it does not occur if you’re running a native Attain server. Edited by - Tarek Demiati on 2001 Nov 23 04:33:41