web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Leaving Microsoft Dynamics NAV Screens forms rejecting input data

(0) ShareShare
ReportReport
Posted on by 5

Hi together!

As a software auditor I have to proof if in any ERP software it is possible to leave screen masks rejecting before inputted data.  Often ERP programs based on MD NAV (formerly Navision) fail this test. Any in a screen form inputted data directly goes to the database. There seems no possibility to reject inputted data or making some undo while the screen form is open. 

I'm curious if this is really a problem by MD's design. May be there are any workarounds unknown to the audited MD NAV developers.  

Greetings, Halweg

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    On Form there is a trigger called OnQueryCloseForm, where you can add code to do the validation if data entered is correct or not and ask the user to change it before closing it. Even on the validation of every field you can add the code.

  • Halweg Profile Picture
    5 on at

    Thanks for the fast response, Suresh.

    You tell me about input validation.

    But if I wrote formal valid data into an input field (or a screen form) there's no way to discard the changes?

    Isn't there any undo-function or kinda database-smart-recovery to get the information just before the user entered new data into the form field?

    It seems to me the programmer must save the previous content of each field to have an option to restore the data. But this would lead to a new invalid timestamp, right?

    Greetings, Halweg

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    What is your Navision Version ? Let me explain what i mean for example if you are inputting a salesperson code on Customer and you want only SP value to insert not any other value, then on the validation of salesperson code you will add this code

    If "Salesperson Code" <> xRec."Salesperson Code" THEN BEGIN

      IF "Salespeson Code" <> 'SP' THEN

           ERROR('Message');

    The Error Statement will not save the date user entered and they have to correct it to close the form or changes they entered will discard.

  • Halweg Profile Picture
    5 on at

    Thanks Suresh!

    I'm not a MD programmer but an auditor. Here in Germany in my environment are some rules for user interaction.

    A test case is to have a (partially invalid) postal address record  (name, place, street etc.) and enter it in a screen form. At the end of the input form the user should be able to discard all changes not leaving any timestamps or similar.

    I want to help the programmers in finding a way to get this when using Navision (any actual version).

    Greetings, Halweg

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    By using above methods you can discard the changes.

  • Halweg Profile Picture
    5 on at

    Just for understanding:

    The programmer has just
    - add a Cancel button to the form

    - make the button press event to (1) set any cancel condition and (2) close the form

    - proof the cancel condition with the "OnQueryCloseForm" event

    - and when Cancel=True launch the ERROR('Message') statement

    This will discard all changes from the input form and close it? The user may see any Dialogbox with any customizable text? No timestamps are made?

    Is this applicable to any normal input form? Is this new in Navision?

    Greetings, Halweg

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    You don't need any Cancel button by default that is available when you open the form, you need to add the condition on QueryCloseForm event the close action if it is OK or Cancel and perform necessary validations and throw the Error Message which will stop the user closing the form and have the ability to rectify.

    It is not new in Navision,

  • Halweg Profile Picture
    5 on at

    Thanks again!

    In my case the cancel button (or any other cancel-control) is essential: the user should be able to freely decide to reject the input. For his decision he needs an explicit and clear control. There's no special data condition.

    I wonder why programmers don't use this apparently easy mechanism. May be there are some problems with nested forms (i. e. input new client-data leads to the input new country dialog or similar).

    I missed the cancel-function (on a form level) with all audited ERP-solutions based on Navision. 

    Greetings, Halweg

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    If you open any standard form, normally it don't have any cancel button.  It is very important to know what version you are referring because in the newer version there are no forms there are only pages.

    We can program to add the cancel button but that is for each form you have to program that way.

  • Halweg Profile Picture
    5 on at

    As an auditor I often don't know which version of Navision / MD they use. I have to inspect programs based on Navision every 2-3 years. Also do my colleagues, they have the same test cases. A 2013 reported Dynamics NAV Version was "2009 (Version 6)".

    And yes, often there were no "Cancel" buttons. The users demand is to have an "option to leave a partially filled screen form without changes in the database".

    But I don't know if the audited screen forms were Navision forms or "pages" or something self-made.  

    But the unique statement from the programmers was "There's no way to make the user able to reject (or undo) input as soon as he leaved one or more input fields by cursor movement. This is a Navision issue."

    Currently I'm updating the test criteria and together with a user group I have to decide how to handle Navision based programs test failing.

    Greetings, Halweg

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans