C/AL makes me crazy ](*,)
I am trying to modify the database using Rec.MODIFY from the 'Form - OnNextRecord(Steps : Integer) : Integer' but I receive the message 'You cannot make any changes in the database from this trigger.'
'Form - OnBeforePutRecord()' which has a description of 'The C/AL code in this trigger is executed before a record is saved. ' gives me the same message.
I simply want to clear a couple of fields if a certain criteria is met, before leaving a record displayed in the Sales Quote Form.
This would be required on insert of a new record, on close of the form, choosing the next record, choosing the previous record, etc.
Is there a standard way of doing this? I am using 3.7A.
Any help is greatly appreciated. Thank you.
0
Answers
At least I can stop the user from navigating anywhere else until they make a change to the record -
using the code IF ("No." <> xRec."No.") AND (xRec."No." <> '') THEN BEGIN .... etc.
http://www.mibuso.com/forum/viewtopic.php?t=5167&highlight=modify+trigger
CurrForm.UPDATE(FALSE);