October 17, 200718 yr I am having trouble with the following script: I am on Invoice layout and have a button “New Customer” with script that should do the following: - Open a new window based on Customers table - The user creates a new record (new customer) enters data - The user clicks on a “Close” button on this “New Customer" layout to close it. The user is allowed to close the “New Customer” window only if Name and PhoneNbr fields are not empty. What I have so far is: New Window [Name: “New Customer”; etc…] Go To Layout [“New Customer”, etc…] Pause/Resume (Indefinitely) ------> (to allow the user to enter data) : -------> I don’t know what should come next : I couldn’t find a Resume script that would allow me to proceed as follows: If [not isempty(Customers:Name) and not isempty(Customers::PhoneNbr] Resume Script step Close Window and attach it to the Close button on the “New Customer” layout What script should I attach to the button on the Invoice layout? What script should I attach to the button on the New Customer layout
October 18, 200718 yr If you have the Status Area in view mode there will be a "Continue" button shown. You click that button to continue the script. If you prefer you can add a button on your layout to continue the script as well. Btw, your script: If [not isempty(Customers:Name) and not isempty(Customers::PhoneN br] will only work if both fields are empty not if either field is empty. Perhaps you want 2 separate If statements or a case statement. If(not isempty(Customers:Name) Show Custom Dialog(Customer Name Field is Empty) Pause/Resume Script Endif If(not isempty(Customers:PhoneN br) Show Custom Dialog (Customer Phone Field is Empty) Pause/Resume Script Endif I guess you could also use If (not isempty(Customers:Name)) OR If(not isempty(Customers::PhoneN br)) **Just as a disclaimer - I always have to putz with my scripts to get them right! *** HTH
October 18, 200718 yr Hi, A button may have several options ( Pause, Resume, Exit , Halt ) Make sure the correct option is selected if you want the script to proceed. You have several options. My favorite is to use a sub-script ExitScript [parameter] that would give the main script a scriptResult, which is the parameter entered, which would be your validation calc. Then Get ( ScriptResult ) would therefore, as it says, be used by the "first" script to either proceed or not HTH, not sure I'm very clear :)
October 18, 200718 yr Author It took me time to understand the subscript thing; I got it working and problem solved. Thanks guys.
October 18, 200718 yr It took me time to understand the subscript thing Congrats, re-reading my answer, it's still unclear to me what I've been writing :)
October 18, 200718 yr Ugo wrote: "re-reading my answer, it's still unclear to me what I've been writing" I'm going to wait for Soren's reply. :)
Create an account or sign in to comment