September 1, 200520 yr 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 September 1, 200520 yr by Guest
September 1, 200520 yr 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.
September 1, 200520 yr Author 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
September 1, 200520 yr Try: if [ IsEmpty (Get (SriptParameter))] You need to use the Get to get the value of the script parameter.
September 1, 200520 yr Author 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
September 1, 200520 yr 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.
September 1, 200520 yr Author 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....
September 1, 200520 yr 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) , ""]
September 1, 200520 yr Author wait.... how do i set it up like that Edited September 1, 200520 yr by Guest
September 1, 200520 yr 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.
September 1, 200520 yr Author i know that part...but how do you define the set field to look for the script parameter
September 1, 200520 yr In Set Field, the target field cannot be specified by calculation. Maybe in version 9...
September 1, 200520 yr 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.
September 1, 200520 yr 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.
Create an account or sign in to comment