If [ Isempty ( Invoices::Customer_ID ) ]
Your script goes here
You can also use a custom dialog to ask the user if they really want to create a new customer record before doing so.
Thanks! That works great!
Now I tried adding the Custom Dialog Box After the "If[IsEmpty (Invoices::Customer_ID)]" step. The problem I'm having now is that when I click "Cancel" on the dialog box, the rest of the script still executes.
How do I add a step that tells the dialog box that OK means go ahead with the script and Cancel means to stop it.
After the show custom dialog step, add an If step that uses Get ( LastMessageChoice ) to identify which button was clicked.
Show Custom Dialog [
If [Get ( LastMessageChoice ) = 1 /* Ok was clicked */ ]
The script is doing exactly what you told it to do. That's just not what you want it to do ;-)
Move the End If to the bottom of your script so that "New Window" through "Insert Text" only executes if the user clicks OK.
BTW, Set field is almost always a better choice that Insert Text for entering data into a field. Insert Text requires that the field be present on the current layout in order to insert text. Set Field does not.
Hahaha. Yeah...I'm trying to wrap my head around scripting but, it's difficult for me =)
That worked great. Thanks again for the help!