Hi everyone,
I am trying to run some code and hit the following error:
Microsoft Dynamics NAV
---------------------------
The following C/AL functions are limited during write transactions because one or more tables will be locked. Form.RunModal is not allowed in write transactions. Codeunit.Run is allowed in write transactions only if the return value is not used. For example, 'OK := Codeunit.Run()' is not allowed. Report.RunModal is allowed in write transactions only if 'RequestForm = FALSE'. For example, 'Report.RunModal(...,FALSE)' is allowed. XmlPort.RunModal is allowed in write transactions only if 'RequestForm = FALSE'. For example, 'XmlPort.RunModal(...,FALSE)' is allowed. Use the COMMIT function to save the changes before this call, or structure the code differently.
---------------------------
OK
---------------------------
By debugging, I got the line which caused the error:
Rollback := NOT (CheckAvailability.RUNMODAL = ACTION::Yes);
What shall I do to avoid it?