How to Validate a field while opening a page.

Hello Everyone,

How to validate a field while opening a page.

For example: System must call Validate of “Direct Unit Cost” field while opening Requisition Worksheet page. I tried Validate function in OnAfterGetRecord and OnAfterGetCurrRecord. it didn’t work out.

Thanks in advance :).

Have you tried in the OnOpenPage Trigger?

Yes tried. still same error:

Microsoft Dynamics NAV

A transaction must be started before changes can be made to the database.

Page Edit - Req. Worksheet - DEFAULT ∙ Default Journal must close.


I suugest to set a flag in onOpenPage and process it in onAfterGetRecord.

Hello Vinamis,

Thanks for your information. I am asking quite a bit. Could you please brief me?


Can you give us more details what is you exact requirement so we can help.

In Req. Worksheet Page, i created remaining amount field and Amount in PO field. When user updates the “Direct Unit Cost” field, systems updates the Amount field, which shows difference amount from the Amount in PO field.

So, i need to validate the “Direct Unit Cost” manually to update the Remaining Amount field. Hence as soon as user opens the page, system must validate the “Direct Unit Cost” field to update the “Remaining Amount” field.

It’s a customized functionality.