Jump to content

set field to script parameter


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

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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