Forms and Pages are editable in lookupmode

Some forms and pages in Dynamics NAV are used both for setup and look up.  For example form and page “Payment Terms” with ID 4.  I like to add a code to forms and pages to prevent this.

On forms:
[code]OnOpenForm=BEGIN
CurrForm.EDITABLE := NOT CurrForm.LOOKUPMODE;
END;[/code]
On pages:
[code]OnOpenPage=BEGIN
CurrPage.EDITABLE := NOT CurrPage.LOOKUPMODE;
END;[/code]
This causes the form or page to be write protected if they are opened as a look up from the “Payment Terms Code” fields.

2 Replies to “Forms and Pages are editable in lookupmode”

  1. I don’t really understand the reasoning for this. Personally I hate it when I can’t edit the data I’m looking up. A good example is the Bin List. You have to go “all the way over” to the Location List to correct that one Bin who has the wrong Max Quantity. It’s a massive timewaster.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.