Newbies timber123 Posted September 7, 2010 Newbies Posted September 7, 2010 Hi, I could do with some help/advice please. I want to create a report layout in which my users can veiw their results, after they have performed a date range find via a custom dialog box (the field to search is a date type field). My question is: how do I set this script up so that my users can enter their search criteria (date range)when promted into my custom dialog box? Hope I've made sense? Your help is appreciated. Many thanks.
LaRetta Posted September 7, 2010 Posted September 7, 2010 Custom Dialog[] has tabs for input data. You would use two global fields (which can exist anywhere in your file and don't have to be related in any way). gStart and gEnd. 'Show Input Field #1' would point to gStart and text would say, "Enter start date". Repeat for input Field#2. Script can even pre-fill a start and end date if you wish or ... if you leave either date blank, FM will handle it for you. Pseudo-script would look something like this: Show Custom Dialog [ OK ; Cancel ; "Enter your date range" ] If [ Get ( LastMessageChoice ) = 2 // user selected cancel ] Halt Script (or do whatever you wish if user doesn't want to continue Else Enter Find Mode [ uncheck pause ] Set Field [ yourDateField ; gStart & ".." & gEnd ] Set Error Capture [ On ] Perform Find [ ] If [ not Get ( LastError ) ] ... do what you wish with found set End If Note that when date ranges, it isn't necessary to have a start and end date. FM would accept ...9/30/2010 and presume all PRIOR dates; or it could end up looking like 9/1/2010... and FM will presume all dates after that date. Or you can prefill with starting fiscal date or even prefill with standard current months range. Options are endless. Setting the globals before your Custom Dialog[] allows users to see the default setting and can save them time if a standard default is the norm.
Newbies timber123 Posted September 7, 2010 Author Newbies Posted September 7, 2010 Many thanks for your help. I understand the example script that you have posted from a logical point of veiw, however, I am relatively new to FM and I have little knowledge of globals (and their function/useage) and the set field step. Can you tell me how the globals could work in relation to my already present date field? and can the globals be hidden in the layout? Many thanks, Simon.
Recommended Posts
This topic is 5190 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