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

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

Recommended Posts

Posted

Greeting!

I'm setting up a searching script to allow user searching in a date range. I use two global date fields to hold the beginning date and the finishing date. The problem is: I cannot enter anything in these two fields in find mode.

Posted

Welcome!

Finding in globals won't work. Know why? Because globals are the same for all records. You want to enter the dates in these globals, then go into find mode

If you want to find a date range of one field from two globals, you would want to do something like this:

Go to Layout [Layout that the date field is on]

Enter Find Mode [ ]

Insert Calculated Result ["Date field you want to find in" , "DateToText(g_datefield1) & "..." & DateToText(g_datefield2)

Perform Find []

Where g_datefield 1 and 2 are your two global date fields

I just did this off the top of my head, so make sure you test it.

Ken

Posted

You would want a specific layout with only those globals used for your find criteria, yes. Otherwise, you run the risk of changing valid data in other fields.

Posted

Well, you could put nonglobals on the same layout, but you'll want to disallow entry, to prevent them from being accidentally modified.

Posted

It seems to me that this question has gotten a bit off track. To search for a date range, you can enter the start and end dates in global fields while you are in browse mode. Then, run a script that switches to find mode, and possibly switches to another layout with the actual date field that you want to search. Then use the "Insert Calculated Result" script step to pu the find criteria into the date field:

Enter Find mode

Go to Layout [DateFindLayout]

Insert Calculated result [DateField, gStartStart & "..." & gEndDate]

Perform find

Go to Layout [original layout]

Posted

This was already explained, and further questions were closely related and hardly off-track for this to perform as desired without screwing up existing data.

So why the need for a duplicate post?

Posted

Guilty as charged. I brought it up again partly because the thread got long enough that I had forgotten Ken's original explanation, and also it appeared that there had been some comments that had misled Newcomer into thinking that (s)he needed to do something a lot more complicated than necessary.

Posted

Yes, I was thrown off by the whole "Can I not put fields other than global fields on the layout?" question.

I have two globals set up in the upper right corner of my layouts - a sort of quick range find. So in this case, the globals can be on the same layout as the other fields.

JT seems to be talking more about a search layout, in which case it is good to use all globals and set your fields to their values.

Ken

Posted

Agreed, I was just trying to help prevent what sounded like a catastrophe in the works.

This topic is 7759 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.