Hello,
To plug some linked treatments in job queue with no error message, i have create a codeunit that run an other codeunit such like this :
Codeunit 50000 (called by jobQueueEntry."parameter string" = 1)
IF CODEUNIT.RUN(50001,JobQueueEntry) THEN BEGIN
FctWriteSuccessLog();
JobQueueEntry."parameter string" := 2;
IF CODEUNIT.RUN(50001,JobQueueEntry) THEN //error
FctWriteSuccessLog()
ELSE
FctWriteErrorLog();
END ELSE
FctWriteErrorLog();
My problem is that i receive an error message during the second run of the codeunit 50001 :
The following C/AL can be used only at a limited degree ... Use the COMMIT function ...
I first thought it comes from my var JobQueueEntry which i modified just before the codeunit.run but even if i don't modify it i still receive the error...
I have tried many different ways to do this (using var codeunit instead of codeunt.run, using temp var for modified jobQueueEntry,...) but still the error..
Could you help me please? it seems i can't do 2 "IF CODEUNIT.RUN THEN" in the same function...
Thanks
Nicolas
Answers
Nicolas
This means that if you want the C/AL codeunit to perform a single write transaction, the system automatically handles it for you. However, if you want the C/AL codeunit to perform multiple write transactions, you must use the COMMIT function to end one write transaction before you can start the next. The COMMIT function separates write transactions in a C/AL code module.