Before the " New Ident Number [new ident-no.] " dialog opens in 3Dfindit, a script on the server can check whether certain prerequisites are met. Depending on the result, it prompts the user for input, displays a message, or terminates the process with a message, preventing the dialog box from opening. The script does not modify any data.[79]
Wear
Enter the compiled script ( .vbb ) in the erpcustom.cfg :
[SERVER_BEFORE_SHOWDIALOG] 1=$CADENAS_SETUP/scripts/erp/erp_before_showdialog.vbb
If
the check is to apply only to a specific role, the block is [SERVER_BEFORE_SHOWDIALOG(<groupName>)].
The
script contains the Execute(context) function. It must return 1
. Any other value or exception is considered an error.
Via
context, the script has access to the following
information and messages:
-
Table,Document -
QueryConfirmed Trueif the request is repeated after the user has confirmed a prompt or a message . Read-only.-
Ask(message [, title [, confirmText [, cancelText]]]) Displays a prompt. If the user confirms, the dialog box opens; if the user cancels, the process ends. Optionally, you can specify the window title and the labels for the two buttons.
-
ShowInfo(message [, title [, buttonText]]) Displays a message. After you confirm, the dialog box opens. Optionally, you can specify the window title and the button label.
-
StopWithInfo(message [, title [, buttonText]]) Displays a message and terminates the process. The dialog box does not open, even on the second run after confirmation. Optionally, you can specify the window title and the button label.
Before the dialog box opens, the user is asked if they would like to continue :
Function Execute(context)
context.Ask("Do you want to continue to the ERP dialog?", _
"Assign ERP number", "Proceed", "Stop")
Execute = 1
End Function
![[Note]](https://webapi.partcommunity.com/service/help/latest/pages/en/ecatalogsolutions/doc/images/note.png)
erp_before_showdialog.vbb