To prevent some important data from unwanted modifications, we integrated a so-called “Modification Button” in several forms, so as in form 42 “Sales Order”. There is following code behind this button:
In the subform 46 “Sales Order Subform” the new function “SetFormEditable” looks as follows:
This works more or less fine, but has one big problem: If there aren’t any records to show in the subform, the subform is not only set to “not editable” but also automatically set to “not enabled”! And the status of the subform remains “not enabled” even if you change to status of the main form to “editable”.
I attempted several combinations of CurrForm.ACTIVATE, CurrForm.ENABLE, etc. but the only workaround that ran was inserting an empty sales line, change the subform to “editable” and than deleting the just created sales line. Has anyone a better solution? Thanks in advance.