August 26, 201015 yr I have a schedule button that goes to the schedule layout. I'd like the button to do a search and return only the results for today if it is before 6:00 pm and for tomorrow if it is after 6:00 pm. Is there an IF function I can use for this? Just to clarify, I mean 6:00 pm actual time right now not the appointment times. Something like If (system time < 6:00 pm ; find date // ; // +1) Edited August 26, 201015 yr by Guest
August 27, 201015 yr Set Variable[ $now ; Get(CurrentTime) ] Set Variable[ $today ; Get( CurrentDate ) ] Set Variable[ $dateWanted ; Case( $now < Time(18;0;0) ; $today ; $today + 1 ) ] Perform Find( $dateWanted ) // using variable in Find requires FM11 Today will start at 12 am, does that work for you? Also you may want to use Get(CurrentHostTimestamp) if it's a hosted solution.
August 27, 201015 yr Author Thanks so much for the help. I think I'm almost there. The last part when you perform the find...it says the provided find criteria is not valid when I run the script because I had it correlate the search field with the date field. When I create the find criteria it says "Find records when:" and then I have to pick a field that correlates with the criteria. $dateWanted is not one of the fields I can correlate to so I had it correlate to the date. how can I get around this?
August 27, 201015 yr Author Yes I have a time field that says when the appointment is. But all I need is for it to show the correct date which it looks like what you gave me works great! I'll let you know if different. Thanks so much for the help! I've learned a lot with you.
Create an account or sign in to comment