Doug T Posted October 10, 2006 Posted October 10, 2006 What is the script step to perform a find for a range of dates to be entered by the user. Is there a way the user can use the drop down calendar.
palomendes Posted October 10, 2006 Posted October 10, 2006 post him a warn box of how to do it (...starting date...ending date) and specify the field where they going to input this info. in scriptmaker you can use an SHOWCUSTOMDIALOG to do this hope this helps
Doug T Posted October 10, 2006 Author Posted October 10, 2006 Thanks for your reply. However, I have been unable to figure out how to prompt the user to enter the date range from within the script. Remember I'm a beginner.
Ender Posted October 11, 2006 Posted October 11, 2006 Hey Doug, Define a Start Date and End Date field and go into the Options for each. On the Storage tab, select Global storage. Then your script could run like this: Show Custom Dialog [ "Message" ; "Enter a date range to search:"; Start Date; End Date ] Enter Find Mode [] Set Field [ Date ; Start Date & "..." & End Date ] Perform Find [] I don't think you can use a drop down calendar in a Custom Dialog, so if that's important, you'll need to setup a dedicated layout with those two global Date fields, with the drop down calendar option attached, and have your script run like this instead: Go to Layout [ Dates ] Pause Script [ indefinately ] Go to Layout [ original layout ] Enter Find Mode [] Set Field [ Date ; Start Date & "..." & End Date ] Perform Find [] A button with the 'Resume Script' command would be needed to continue the script. Of course, you could pretty that up a bit, but that's the general idea.
Doug T Posted October 11, 2006 Author Posted October 11, 2006 THANKS ENDER! Just what I was looking for. Your solution was simple, step by step and worked perfectly. My first time on Forums, great. Doug T
nedbguy Posted November 8, 2006 Posted November 8, 2006 This looks good for v8. Now how would one do the same thing in v.6??
nedbguy Posted November 29, 2006 Posted November 29, 2006 I still can't get this find to work in v6. Anyone have any ideas?
Ender Posted November 29, 2006 Posted November 29, 2006 (edited) It's similar. If I remember right, in FM6 you can't use Set Field[] to set a date range in Find Mode. Instead, use: Insert Calculated Result [ Date , Start Date & "..." & End Date ] You have to make sure you're on a layout containing the Date field when that script step is executed. Edited November 29, 2006 by Guest
nedbguy Posted November 29, 2006 Posted November 29, 2006 That has me closer. But I am now getting a errror message "There are no valid criteria in this request. Type a valid request before clicking Find. My script reads as follows; Show custom dialog ["Enter a date range to search", "Enter a date to search", "Lowest Date", "Highest Date" Go to Layout ["PastEventSearch Layout"] Pause/Resume Script [] Go to Layout [original layout] Enter Find Mode [] Insert Caclulated Result [select, "d_ContractDateOut", "Lowest Date" & ".." &"Highest Date"] Perform Find [Replace Found Set] Go To Layout ["ListView"] Sort [Restore, No dialog] The "Lowest Date" and "Highest Date" fields are global. And this is in FM6.
Ender Posted November 29, 2006 Posted November 29, 2006 Is the d_ContractDateOut field on the original layout or just on the PastEventSearch Layout?
Ender Posted November 29, 2006 Posted November 29, 2006 Remove any quotes around the fields in the Insert Calculated Result calc. If you still have trouble, try adding a Pause in there to see what values are actually being set in Find Mode.
nedbguy Posted November 29, 2006 Posted November 29, 2006 I can not remove the quotes. Tried putting a pause script line just before this line. Script just pauses on the PastEventSearch layout. Same result if I put the pause after the line.
Ender Posted November 29, 2006 Posted November 29, 2006 Perhaps you can post a clone of the file, or put together a basic example of what your script is trying to do.
comment Posted November 29, 2006 Posted November 29, 2006 1. Why can't you remove the quotes? 2. Put your pause between 'Insert Calculated Result' and 'Perform Find'. Copy the contents of d_ContractDateOut and paste it here.
nedbguy Posted November 30, 2006 Posted November 30, 2006 1. Why can't you remove the quotes? Good question. in version 6. FM automatically puts them there. 2. Put your pause between 'Insert Calculated Result' and 'Perform Find'. Copy the contents of d_ContractDateOut and paste it here. Not sure what you mean here. Or how I can do this as the window that is being displayed is the PastEventSearch layout. I will try to upload a stripped down copy so you can see what is going on... Best, Chris
Lee Smith Posted November 30, 2006 Posted November 30, 2006 Without seeing the file, everyone is guessing here. My WAG is that you are looking for the wrong type of quotes. i.e.The quotes are smart and you trying to find and reply them with plain quotes, or vice versa. HTH Lee
nedbguy Posted November 30, 2006 Posted November 30, 2006 I understood him to mean these quotes(in red) Insert Caclulated Result [select, [color:red]"d_ContractDateOut[color:red]", [color:red]"Lowest Date[color:red]" & ".." &[color:red]"Highest Date[color:red]"]
Ender Posted November 30, 2006 Posted November 30, 2006 FM6 shows quotes around the arguments in the script steps, but the calc itself should not have quotes around the field names. It should look like: Lowest Date & "..." & Highest Date Or in the Edit Script window: Insert Caclulated Result [select, "d_ContractDateOut", " Lowest Date & "..." & Highest Date "]
Recommended Posts
This topic is 6568 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