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

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

Recommended Posts

Posted

So this might be a bit hard to explain but let me give it a go. I have a search interface in which you type the text you're searching for in a global field called "g_SearchText" and there's another global field (formatted as a pull down menu) called "g_SearchCriteria" where the user chooses in which field they will be searching. Now, in scripting the search I am trying to use the SetField function to put together a find based on the user's request. The function looks like this: SetField["g_SearchCriteria" , "g_SearchText"]

Here is the problem that arises:

When I use the SetField function to put the text from g_SearchText into the appropriate field, the function wants to set g_SearchCriteria rather than the field specified by g_SearchCriteria.

Does that make sense? If not, I can post an attachment cuz this is really bugging me.

Posted

You cannot dynamically determine the field to set in a Set Field step. It must be explicit. However, you could test the field and set the appropriate one, such as

If [g_SearchCriteria = "field1"]

Set Field [field1, "data"]

Else

If [g_SearchCriteria = "field2"]

Set Field [field2, "data"]

...

End If

End If

Posted

You can get field data from a variable field name (with GetField), but there is no way to Set a variable field name (no SetField [ TextString , Calc ]).

You can use a series of If statements in your scripting to set the correct one:

If [ g_SearchCriteria = "Name" ]

Set Field [ Name ; g_SearchText ]

Else

If [ g_SearchCriteria = "Age" ]

Set Field [ Age ; g_SearchText ]

End If

...

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