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

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

Recommended Posts

Posted

I'm working on a troublesome layout, which involves a layout to enter find criteria, and another to display the results. I want to display the search criteria in the results layout, and have been advised that setting a Global Variable to the value of the search field is the best way. This is in a script triggered on leaving the field.

However, I cannot for the life of me find a script action that "gets" the current field value and allows me to include it in a calculation that stores the result in a global variable. (Not without altering the contents of the field, anyway.)

Any help would be great.

Thanks.

Posted

I want to display the search criteria in the results layout, and have been advised that setting a Global Variable to the value of the search field is the best way.

We don't have the context in which this takes place. How exactly are users entering the search criteria? If they use global fields (and why would they not use global fields?), then you can display those global fields directly, without transferring their values to variables.

In any case,

Set Variable [ $$yourVariable ; Value: YourTable::SearchField ]

would do what you have asked for. However, if the criteria are entered in Find mode (i.e. not into a global field), then the variable must also be set while still in Find mode.

Posted

Thanks, I couldn't find "Set Variable". (I seem to be completely blind when it comes to finding these actions in the list at the side...!!)

Without wishing to get sidetracked by global fields -- My understanding of a global field is a field that carries the same value for all records. So if I used that as my search criteria, wouldn't I get every record as the result?

As things stands, the search fields are drop down boxes of Value Lists. So far, it all seems to be working well. (Except displaying the results, but that's for another day.)

Posted

You wouldn't actually search IN the global, you'd just use it to specify the criteria. E.g. you have a global called FindThisName, and then use it in a script like this to perform a search on your (non-global) Name field:

Enter Find Mode

  Set Field( Name ; FindThisName )

Perform Find

Posted

I'm not sure that I see the advantage of a Global field rather than a global variable.

As it stands, I have a list of items in a Value List, (which relate to a sub-table of "attributes" that each record can hold zero or more of). The user selects an attribute from a drop-down list, and the search shows all the records that contain that attribute. The Results layout shows a list of the records that hold that attribute**, and I have the name of the attribute at the top of the list, so you know what you've searched for.

If I did this using Global fields, I would have to select a value from the drop-down list, then set the global field to the selected value, and then set the field I want to search to the value in the Global Field. Whereas at the moment, I just select the value from the list in the relevant field and just use a Global Variable to pass the name of the search. Isn't that quicker?

** except I'm having trouble producing a list, but that's another story.

Posted

The advantage of a global field (in this context) is that users can enter data directly into a global field AND they can do so both in Browse or Find mode AND there is no danger of modifying actual data while entering search criteria.

If I did this using Global fields, I would have to select a value from the drop-down list, then set the global field to the selected value, and then set the field I want to search to the value in the Global Field.

No, not exactly: you would select a value from the drop-down list directly into the global field.

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