gaby78 Posted October 17, 2007 Share Posted October 17, 2007 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 Link to comment Share on other sites More sharing options...
aldipalo Posted October 18, 2007 Share Posted October 18, 2007 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 Link to comment Share on other sites More sharing options...
Ugo DI LUCA Posted October 18, 2007 Share Posted October 18, 2007 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 :) Link to comment Share on other sites More sharing options...
gaby78 Posted October 18, 2007 Author Share Posted October 18, 2007 It took me time to understand the subscript thing; I got it working and problem solved. Thanks guys. Link to comment Share on other sites More sharing options...
Ugo DI LUCA Posted October 18, 2007 Share Posted October 18, 2007 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 :) Link to comment Share on other sites More sharing options...
Vaughan Posted October 18, 2007 Share Posted October 18, 2007 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. :) Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6197 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now