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?
Comments
regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
The CheckAvailability .RUNMODAL is a call to page 342 CheckAvailability to check the availability of each item (this call already exists in codeunit 311, I didn't add it myself).
So, how can I go around this???
Of course, technically, you could with the process you have coded already, but can then only call PAGE.RUNMODAL after you have committed the modifications first 9allowing you to execute PAGE.RUNMODAL), but most probably that's functionally not what you want.
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
Rollback := NOT (CheckAvailability.RUNMODAL = ACTION::Yes);
I noticed there was a KB to fix it, and downloaded NAV.7.0.40118.AU object set and merged in the changes related to the inventory check. That fixed the issue when copying document, and in other cases. However the issue is still occuring when exploding BOM's. Very hesitant to put a COMMIT in there so would love to know how you or anyone else fixed this.