Friday, July 1, 2016

Confirm dialog box to confirm the process flow | NAV

Dialog boxes can be used in the place of "Message"in Dynamics NAV. It gives the option to route through if else condition with better documented options. The CONFIRM Dialog box are generally used in the same way as the MESSAGE function to display a message. However, unlike the MESSAGE function, the CONFIRM function has a required return value.

It also gives us option to handle the continuous process which are dependent and needs series of input (Confirmation) from the user. Please refer the image below.



In this Example i have used the series of Confirm dialog box to achieve a goal to retain the Sales line record. The Message should be informative enough for the user to understand the process and select the right choice. This is very friendly if used properly. 

The CONFIRM function has the following syntax.

//---------------------------------//
Confirmed := CONFIRM(Message,[Value],'.');

//--------------------------------//

Example:

//<<RBN---
IF HideValidationDialog OR NOT GUIALLOWED THEN
Confirmed := TRUE
ELSE
Confirmed := CONFIRM(Text001,FALSE,'.');
IF Confirmed THEN
//If Condition
ELSE
//Else Condition
//HideValidationDialog---->Boolean
//Confirmed----> Boolean
//Message[Text001]---->Message for Dialog Box. Eg: Do you want to do ____
//>>RBN---


//--------------------------------//

Code Screenshot:



Cheers!!!