February 27, 20196 yr Hi. I have a database that lists grant applications. I need for my user to be able to view the records in a number of ways according to certain criteria for analysis purposes. These records are displayed in a List layout. I need to be able to: 1) see only records where the submission dates are between x and y then 2) filter these records according to what is selected in 2 dropdowns - Outcome and Status. The Outcome field dropdown value list is : <blank>, granted, unsuccessful, unknown. The Status field is dropdown value list is: <blank>,submitted, in progress, finalised. The <blank> is where that dropdown criteria are not required. Ideally, I'd like to be able to set the dates, select from the dropdowns and perform the find, but happy to do it in 2 steps if necessary. I've tried several things from solutions found searching the internet, but nothing seems to work and I'm getting increasingly frustrated with it. I'm not a coder and anyone good enough to help me out here needs to be aware of this. While I've been using FM on and off for a number of years, I'm by no means an expert or even near it. Thank you in advance for any guidance with this. You guys have helped me out in the past.
February 27, 20196 yr I suggest you start by defining 4 global fields to hold your criteria - gFromDate, gToDate, gOutcome and gStatus - and place them in the header part of your layout, next to a Find button. Make the button run a script that does: Enter Find Mode [] Set Field [ YourTable::SubmissionDate ; "≥" & YourTable::gFromDate ] Set Field [ YourTable::SubmissionDate ; "≤" & YourTable::gToDate ] Set Field [ YourTable::Outcome ; YourTable::Outcome ] Set Field [ YourTable::Status ; YourTable::gStatus ] Perform Find [] That's a rough sketch, there are many variations and embellishments possible.
February 27, 20196 yr 2 hours ago, comment said: Set Field [ YourTable::SubmissionDate ; "≥" & YourTable::gFromDate ] Set Field [ YourTable::SubmissionDate ; "≤" & YourTable::gToDate ] That wouldn't work. The second set field would overwrite the first set field. Set Field [ table::SubmissionDate; Table::gFromDate & "..." & Table::gToDate ] would work.
February 27, 20196 yr 3 hours ago, OlgerDiekstra said: Set Field [ table::SubmissionDate; Table::gFromDate & "..." & Table::gToDate ] Oops, I don't know where my head was. Thanks for the catch.
February 27, 20196 yr Author Hi. Thank you for the help so far I already had the globals. I started to create the script but when I added the following into the Calculated Result for Set Field, I got the message saying an operator was expected: Grants::Date Submitted;Grants::gSubmittedFromDate &"..."& Grants::gSubmittedToDate Any thoughts?
February 28, 20196 yr You must be doing something wrong. It works just fine for me: Maybe post a screen shot of what you're trying to do.
February 28, 20196 yr Author Still get the same error - just trying to get the dates thing worked out . Screenshot attached.
February 28, 20196 yr The Set Field step has two parts. Grants::Date Submitted is the field you want to set; you select it when specifying the target field. When specifying the calculated result, enter ONLY this into the calculation window: Grants::gSubmittedFromDate &"..."& Grants::gSubmittedToDate
March 2, 20196 yr Author Thank you so very much for your help - as soon as you explained it I realised how obvious it was. I must have been so far down the rabbit hole that I could no longer see the obvious. I was just going through the file in a final check and realised on my global summary layout, I still have an issue with a date thing. I want to show the date of the first record entered and a date of the last record entered. I've done a Summary field for Min and one for Max but nothing shows up in the live view. Any thoughts? Edited March 2, 20196 yr by DreadDamsel
March 2, 20196 yr Why not simply use gSubmittedFromDate and gSubmittedToDate? That is the date range they've entered to search, if you showed them different dates, they might get confused, and think the system is doing something odd.
March 2, 20196 yr Author This is a different purpose - it's simply displayed information, not entered. It's the date the first record is created and the most recent date a record has been created - this date is auto-filled on creation of a new record. It displays on a different layout.
Create an account or sign in to comment