Elwood Blues Posted March 17, 2005 Author Posted March 17, 2005 I tried looking for this in the Forums, but did not find anything that directly addressed my issue. I am trying to make a script that will be assigned to a button. I would like the button to (upon clicking it the first time) enter Find Mode, and then Pause so that the user may enter search criteria. This I have had no difficulty with. However, upon clicking the button for the second time, I would like the script to Resume, taking the criteria and actually performing a find. Is this possible? If not, can anybody suggest an effective way of doing what I am trying to do? Thank you.
Elwood Blues Posted March 17, 2005 Posted March 17, 2005 I tried looking for this in the Forums, but did not find anything that directly addressed my issue. I am trying to make a script that will be assigned to a button. I would like the button to (upon clicking it the first time) enter Find Mode, and then Pause so that the user may enter search criteria. This I have had no difficulty with. However, upon clicking the button for the second time, I would like the script to Resume, taking the criteria and actually performing a find. Is this possible? If not, can anybody suggest an effective way of doing what I am trying to do? Thank you.
Elwood Blues Posted March 17, 2005 Author Posted March 17, 2005 I tried looking for this in the Forums, but did not find anything that directly addressed my issue. I am trying to make a script that will be assigned to a button. I would like the button to (upon clicking it the first time) enter Find Mode, and then Pause so that the user may enter search criteria. This I have had no difficulty with. However, upon clicking the button for the second time, I would like the script to Resume, taking the criteria and actually performing a find. Is this possible? If not, can anybody suggest an effective way of doing what I am trying to do? Thank you.
bikergeek Posted March 17, 2005 Posted March 17, 2005 In the script, you want to have an if statement determine whether the window is in find or browse with get(windowmode), and act accordingly.
bikergeek Posted March 17, 2005 Posted March 17, 2005 In the script, you want to have an if statement determine whether the window is in find or browse with get(windowmode), and act accordingly.
bikergeek Posted March 17, 2005 Posted March 17, 2005 In the script, you want to have an if statement determine whether the window is in find or browse with get(windowmode), and act accordingly.
Vaughan Posted March 17, 2005 Posted March 17, 2005 I have found making dedicated Find layouts to be a real benefit: make then look different from the normal data entry screen so the users can tell the difference, and maybe consider putting pop-up lists on field to make data entry selection easier. The "Find" button on the data entry layout will run the find script below: the "Find" button on the find layout simple has to Resume the script. Another advantage is that users can perform the find by just pressing the Enter key. Allow User Abort [ off ] Go to Layout [ "find layout" ] Enter Find Mode [ pause ] # do not restore find requests # Perform Find [] # do not restore find requests # Go to Layout [ original layout ]
Vaughan Posted March 17, 2005 Posted March 17, 2005 I have found making dedicated Find layouts to be a real benefit: make then look different from the normal data entry screen so the users can tell the difference, and maybe consider putting pop-up lists on field to make data entry selection easier. The "Find" button on the data entry layout will run the find script below: the "Find" button on the find layout simple has to Resume the script. Another advantage is that users can perform the find by just pressing the Enter key. Allow User Abort [ off ] Go to Layout [ "find layout" ] Enter Find Mode [ pause ] # do not restore find requests # Perform Find [] # do not restore find requests # Go to Layout [ original layout ]
Vaughan Posted March 17, 2005 Posted March 17, 2005 I have found making dedicated Find layouts to be a real benefit: make then look different from the normal data entry screen so the users can tell the difference, and maybe consider putting pop-up lists on field to make data entry selection easier. The "Find" button on the data entry layout will run the find script below: the "Find" button on the find layout simple has to Resume the script. Another advantage is that users can perform the find by just pressing the Enter key. Allow User Abort [ off ] Go to Layout [ "find layout" ] Enter Find Mode [ pause ] # do not restore find requests # Perform Find [] # do not restore find requests # Go to Layout [ original layout ]
Elwood Blues Posted March 17, 2005 Author Posted March 17, 2005 I had tried making a separate layout for finding, but ran into a problem whenever a search would yield no results. If you click Continue, there was no problem, but many of the users thought that the Cancel button would take them back to the orginal layout. Much to everybody's dismay, it kept them in the find layout, but in Browse Mode, and they would try clicking on the Find button to get back into Find Mode, but of course, it did not take them there, it just repeated their previous find. How would I get around this? Also what does "# do not restore find requests #" mean?
Elwood Blues Posted March 17, 2005 Author Posted March 17, 2005 I had tried making a separate layout for finding, but ran into a problem whenever a search would yield no results. If you click Continue, there was no problem, but many of the users thought that the Cancel button would take them back to the orginal layout. Much to everybody's dismay, it kept them in the find layout, but in Browse Mode, and they would try clicking on the Find button to get back into Find Mode, but of course, it did not take them there, it just repeated their previous find. How would I get around this? Also what does "# do not restore find requests #" mean?
Elwood Blues Posted March 17, 2005 Author Posted March 17, 2005 I had tried making a separate layout for finding, but ran into a problem whenever a search would yield no results. If you click Continue, there was no problem, but many of the users thought that the Cancel button would take them back to the orginal layout. Much to everybody's dismay, it kept them in the find layout, but in Browse Mode, and they would try clicking on the Find button to get back into Find Mode, but of course, it did not take them there, it just repeated their previous find. How would I get around this? Also what does "# do not restore find requests #" mean?
stanley Posted March 17, 2005 Posted March 17, 2005 Elwood: Put this immediately after your Perform Find[] step: Set Error Capture [On] If [Get(FoundCount)=0] Go To Layout [your browse layout] # You can also put ShowMessage[] in here to tell the user that no records were found. Exit Script End If The rest of your script would continue as before. -Stanley
stanley Posted March 17, 2005 Posted March 17, 2005 Elwood: Put this immediately after your Perform Find[] step: Set Error Capture [On] If [Get(FoundCount)=0] Go To Layout [your browse layout] # You can also put ShowMessage[] in here to tell the user that no records were found. Exit Script End If The rest of your script would continue as before. -Stanley
stanley Posted March 17, 2005 Posted March 17, 2005 Elwood: Put this immediately after your Perform Find[] step: Set Error Capture [On] If [Get(FoundCount)=0] Go To Layout [your browse layout] # You can also put ShowMessage[] in here to tell the user that no records were found. Exit Script End If The rest of your script would continue as before. -Stanley
Elwood Blues Posted March 18, 2005 Author Posted March 18, 2005 Thanks, it worked great. I think I'm going to go with the separate find layout, but bikergeek's advice was also helpful. Thanks again.
Elwood Blues Posted March 18, 2005 Author Posted March 18, 2005 Thanks, it worked great. I think I'm going to go with the separate find layout, but bikergeek's advice was also helpful. Thanks again.
Elwood Blues Posted March 18, 2005 Author Posted March 18, 2005 Thanks, it worked great. I think I'm going to go with the separate find layout, but bikergeek's advice was also helpful. Thanks again.
Elwood Blues Posted April 9, 2005 Author Posted April 9, 2005 I've been refining this Find Layout discussed earlier, and some users have asked me for a button or method that would allow them to Exit Find Mode. I put a button that runs a script that should do so, but for some reason, the user has to click "Continue" on the Status Area. Normally, I like to have this hidden. As soon as the user hits "Continue", it takes them back to their original layout, and all is fine. Is there a script step that can automatically continue the script without user intervention?
fbugeja Posted April 11, 2005 Posted April 11, 2005 For what it's worth, my script may be of help. Before I hit the search button on one layout, I have a drop-down menu that allows the user to select a date (e.g. Today, Yesterday, Last 7 days, last 14 days, etc). Part of the script goes: If [MAIN::gSearchDate="Today"] Set Field[infringements::Date;Get(CurrentDate)] Else If [MAIN::gSearchDate="Last 7 Days"] Set Field[infringements::Date;Get(CurrentDate)-7] etc etc End If gSearchDate has a value list of terms (Today, Yesterday, etc) & Infringements::Date is a field on my search layout. On the same layout as the above drop-down menu, I have a button which takes the selected date and enters it to the Date field on a dedicated search layout: The script for my Begin Search button goes as follows: Allow User Abort[Off] Set Error Capture[On] Go To Layout[your dedicated search layout] Enter Find Mode [] Perform Script[EnterSelectedDate] - enters date drom dropdown menu to Date field on Search layout Pause/Resume Script[indefinitely] - enter other data, then click Continue Perform Find [] If Get[FoundCount]>0 Go To Layout[search results layout - list view] Else Show Custom Dialog["Unsuccessful Search","No records found] Show All Records Go To Layout[Name of layout you want to go to] Exit Script End If Hope this is of use Frank
Himitsu Posted April 11, 2005 Posted April 11, 2005 Elwood, this one isn't too hard... just make another script name it something like, cancel_sendTo that will take them to the layout you want them to return to. Then make a button on the find layout and perform that cancel_sendTo script, now in the define button menu, when you select perform script, there is a pull down menu, that says "halt" current script. Just set that to exit. What that will do is exit the find script and then perform that new cancel script sending the user to where ever or what ever you want in the new script.
Recommended Posts
This topic is 7169 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