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 thoughts on “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.

  2. Peter Wilson says:

    Does a version of NAV exists where CurrPage.EDITABLE is supported? In NAV2009 it is not supported.

Leave a Reply

%d bloggers like this: