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

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

Recommended Posts

Posted

I am trying to write a script that will perform a find based on multiple variables. The script should bring in values from a related db. I tried to use the following:

Enter Find Mode[ ]

Set Field [

Posted

Set Field and the rest work fine in Find Mode. Think about what you see when you enter Find Mode: empty fields. If you're trying to set one field to the value of a calculation based on another field, you may be disappointed since all fields are blank.

There is one type of field that keeps its value: the global field. If you create some global fields, then you can use Set Field in Browse Mode to store your values. When you switch to Find Mode, you can use Set Field again to get the values from the global fields into the fields you want to search.

Posted

Ok, I think I am beginning to understand what is going on. I am trying to set one field to the value of a calculation based on another field. I was assuming that even through I was in the find mode, FM still remembered the record it was in and the contents of those fields were available for use in creating the find request. After all Find Mode does not actually clear the the contents of the fields. So any find request you script that depends on the contents of any field will fail except for globals. This seems to be a serious limitation since it limits your ability to use variables in a find request. Is there away to do a search based on multiple variables?

Thanks

Nick

Posted

In multiuser mode, globals are local to each user; each user gets his or her own set of global fields. This prevents problems when more than one person tries to access the same global field at once.

Related fields can be on the same layout as standard fields. In Find Mode, all fields visible in any layout are searchable (except globals). This is probably why a Set Field based on a related field doesn't do what you want.

You could probably avoid using globals by using Modify Last Find over and over. Start in Browse Mode. Copy something. Enter Find Mode. Paste. Enter Browse Mode. Copy something else. Modify Last Find. Paste. Enter Browse Mode. Etc. I'd stick with globals.

If you are clever about it, you can probably get away with a single global field. Something like this:

(field1=value1

AND

field2=value2

AND

field3=value3)

OR

(field1=value4

AND

field2=value5)

AND means all field-value pairs are in the same find request. OR indicates a new find request.

Posted

I forgot to add in the previous post that I am trying to avoid globals for this purpose. I am building a multiuser db, so I want to avoid globals that might be changed by multiple users.

Also, why doesn't FM let you use Set Field in Find to specify a field from a db in the browser mode? Example, why does not the following script work?

Enter Find Mode [ ]

Set Field [

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