April 10, 200619 yr Hi. I am trying to create a button which will perform a find asking the user to input two dates which they want the records to be between, then to switch to the other layout with the found records. When i go to scriptmaker, i have perform find as the first action with the find request being "Date >= ?" and it won't accept it. how do i get it to ask the user for the dates they want?
April 11, 200619 yr Create two global fields, globStartDate and globEndDate For the script: Show Custom Dialog (show the two global fields for the user to put a start and end date) Go To Layout[Whatever layout it should go to] Enter find mode [No Pause] Set Field [Date; globStartDate & "..." & GlobEndDate] Perform Find That should do it =) ----- Martha :bigshades:
April 11, 200619 yr Author What should the globStartDate and globEndDate fields be? just empty or should they be calculations or something? please elaborate on that aspect. thanks.
April 11, 200619 yr Sorry about that! globStartDate and globEndDate should be date fields that are global but not calculations so leave them empty. Also, a note on the script I told you to create: Before showing the dialog, you can do the following: If(globStartDate = "") SetField[globStartDate; Get(CurrentDate)] End if If(globEndDate = "") SetField[globEndDate; Get(CurrentDate)] End if That will set values in the two fields if they are emptyo so that when the pop-up comes up, the two fields won't be empty, and it makes it easier for the user to know the date format. The above script steps set them to today's date but you could create a calculation to set them to something else. Does that clarify?
April 11, 200619 yr Author I got the find to work without the global field, but it does not work in web companion.
April 11, 200619 yr Author That actually confused me more! I do not want and static dates in the script. I want the user to input them when running the report script. does that still apply?
April 11, 200619 yr Okay. The global fields are temporary places to put the start date and end date that the user enters for the find. So after putting a custom dialog box up that asks for start date (globStartDate) and end date (globEndDate), the script can go to the correct layout, enter find mode, set the Date field as globStartDate & "..." & globEndDate, and perform the find. This shows the user only records within those dates. You can ignore my second post because it's just extra. All it is saying is that you can set the two global fields as some date, so that when the dialog comes up, the two fields won't be empty. So it will say something like: Please Enter Start and End Dates. Start Date: 04/11/04 End Date: 04/11/04 HOWEVER, the user will be able to change these dates, so that they will get the right time period they want. Do you have a file I can look at? That might be more useful.
April 11, 200619 yr I got the find to work without the global field, but it does not work in web companion. Hm... this isn't true, please explain!!! --sd
April 11, 200619 yr Author Aaah i understand finally! ok, i put everything in, but am having problems properly inputting the following line in the script Set Field [Date; globStartDate & "..." & GlobEndDate] I put in Set Field [Date] because that is all i can put in and i keep getting errors. "There are no valid criteria in this request. Type a valid request before clicking find. Can i email you the file though this? let me know.
April 11, 200619 yr I put in Set Field [Date] because that is all i can put in and i keep getting errors. Set Field [Date] Then you want to click on "Calculated Result" and enter globStartDate & "..." & GlobEndDate
April 11, 200619 yr Author Søren Dyhr , The script works in FileMaker Pro but not in IWP. I am testing it with administrator privileges and it just stays on the same layout in IWP. Please help. thanks.
April 11, 200619 yr Author Can you recommend an IWP compatible line replacement for Show Custom Dialog (show the two global fields for the user to put a start and end date)
April 11, 200619 yr Ah that's what you comment meant, thats right IWP are bound to have a layout for that. --sd
April 11, 200619 yr I'm taking a wild guess here becasue I don't use IWP... Can you put the two global fields at the top of your layout and that way the user can enter the dates and then click a button to run the rest of the script? Start Date __________ End Date __________ |Run Report|
April 11, 200619 yr Well if that's an acceptable approach, shouldn't it be scripted either but instead filling a portal via a multicriteria relationship, and the run button's script could be reduced to Commit Record. The reason I say this is that earlier versions had a limitation in listview, preventing more than 5 records shown in listmode, however is this limitation changed, but we used to work around in IWP via a selfjoin portal shown. The workaround isn't in demand any more. --sd
Create an account or sign in to comment