Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

set field to script parameter

Featured Replies

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

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.

  • 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

Try: if [ IsEmpty (Get (SriptParameter))]

You need to use the Get to get the value of the script parameter.

  • 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

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.

  • 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....

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) , ""]

  • Author

wait....

how do i set it up like that

Edited by Guest

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.

  • Author

i know that part...but how do you define the set field to look for the script parameter

In Set Field, the target field cannot be specified by calculation. Maybe in version 9...

  • Author

do you have any alternative courses of action?

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.

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.

  • Author

well i just have to play around with it some more and see

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.