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

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

Recommended Posts

Posted (edited)

i don't want to set the field to the script parameter but define the field i want to be set to the script parameter...

i want field (script parameter) to be set to .....whatever...

Edited by Guest
Posted

Script parameters are not fields. You can define them when you make a button or when you write a script. They can be defined as a calculation.

Posted

can you give me an example of what you mean...because i wrote a script

if [script parameter = ""]

set field [ , "x"

else

set field [ , ""]

i wrote it so that i could use it on several fields for the same purpose and i set it to the fields and set the script paramter to just equal that field...but how do i define the set fields to go to that field as well

Posted

well where is says script parameter i left off the get part..that part isn't the problem is the set field...i know what i want to set the field to...i just need to be able to tell where to set

Posted

Normally the set field names the field. If no field is named it will use the field selected in the browse or find mode. You may want to add a go to field step in your script.

Posted

i can't really select the field because i am making it into a button...can you set go to fields to script parameters...i'd check but i am updateing my software....

Posted

Why don't you assign the parameter with the button, say the field name.

If [isEmpty (Get (SriptParameter))]

set field [Get (SriptParameter) , "x"

else

set field [Get (SriptParameter) , ""]

Posted

When you define the button there is a box near the bottom of the dialog box where you enter the script parameter for that button.

Posted

OK, I see the problem. Here is a test script that works:

If [ IsEmpty ( GetField ( Get ( ScriptParameter ) ) ) ]

Show Custom Dialog [ Title: "Empty"; Message: "Field is Empty"; Buttons: "OK" ]

Set Field [ SetField::TextField; "X" ]

Else

Show Custom Dialog [ Title: "Not Empty"; Message: "Field is Not Empty"; Buttons: "OK" ]

Set Field [ SetField::TextField; "" ]

End If

It looks like you will have to hard code the set field's. You can use an IF [Get ( ScriptParameter ) ) = "FiledName" to select wich setfield to use.

Posted

There is a workaround which I don't particularly like, that involves a loop using the Go to Next Field step (you need to be on a layout with all relevant fields included in the tab order).

You exit the loop if Get (ActiveFieldName) = Get (ScriptParameter), then use SetField without specifying the target field.

This sort of thing shouldn't be normally necessary, and the need for it usually signifies bad data structure.

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