Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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

  • 4 weeks later...
  • 3 weeks later...
Posted (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 by Guest
Posted

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.

Posted

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.

Posted

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.

Posted

Perhaps you can post a clone of the file, or put together a basic example of what your script is trying to do.

Posted

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.

Posted

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

Posted

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

Posted

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]"]

Posted

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 "]

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 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.