My forms for the sales quote, sales invoice e.g use (as defined in the standard) the property
SourceTable: Sales Header
SourceTableView: WHERE(Document Type=FILTER(Invoice))
SourceTablePlacement: <Saved>
If I now use this form in company1 and create an invoice, the table view remains on the saved position of the last invoice (which is basically ok).
When I now switch to company2 and try to open the form it cancels with an error, that the record (which was used in company1) can't be found.
The problem occurs since I put some code in the OnOpenForm trigger to disable or enable some fields for the user to modify. The reason is not in the code by itself, because I don't get any break with the debugger.
Thanks
0
Comments
You can create a new function that encapsulates your code, then you can create a Boolean like bMyFunctionHasRun which tells you if your function was already run to prevent runing all the time. (Check at beginning for true, set at the end to true).
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
I put the part of the code which enables/disables fields into OnActivateForm.