Invalid SourceTablePlacement

Christian_BuehlChristian_Buehl Member Posts: 145
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

Comments

  • RobertMoRobertMo Member Posts: 484
    I assume enabling/disabling is not rec depended. Try putting your code on some 'later' trigger like OnAfterGetCurrRecord().
    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).
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Christian_BuehlChristian_Buehl Member Posts: 145
    Thanks a lot, that worked.
    I put the part of the code which enables/disables fields into OnActivateForm.
Sign In or Register to comment.