Jump to content

Trouble with Pause/Resume script


This topic is 6093 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

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

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

This topic is 6093 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.