Before the " New ID Number [new ident-no.]" dialog box opens in 3Dfindit, a script on the server can check whether certain prerequisites are met. Depending on the result, the script either prompts the user, displays a message, or terminates the process with a message, so that the dialog box does not open. The script does not modify any data.[78]
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 reads:
[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. 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/jp/partsolutions_user/doc/images/note.png)
erp_before_showdialog.vbb