Is it possible to change the property DeleteAllowed in C/AL Code?
When a value is entered in the heading, the lines in my subform may not be deleted anymore
No, but you can write code to a. make the subform non-editable, or b. (more specifically) prevent users from deleting records in the subform. You may want to use the OnDeleteRecord trigger, or (preferably; if the application allows it) handle this at table level.
You can write a function to check if there is a value in your heading.
If the return value is true then place an error message in the Ondelete trigger in your table.
Your record will not be deleted
Comments
Jan Hoek
Product Developer
Mprise Products B.V.
IF veldA = '' THEN
CurrForm.Subform.EDITABLE(TRUE)
ELSE
CurrForm.Subform.EDITABLE(FALSE)
I can't modify the line that's ok but I still can delete a line in my subform
If the return value is true then place an error message in the Ondelete trigger in your table.
Your record will not be deleted
It works
\:D/ \:D/ \:D/