Skip 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 A Dynamic Field For Scripts

Featured Replies

Is there any way to set a field that a Set Field[ ] or Insert Calculated Result [ ] script step can use for the specified field?

I built a calendar file today. I want to be able to create about 111 scripts to Copy, Copy/Paste, and Set Field. Copy is too easy. Copy/Paste is easy enough, but I have to go in and respecify the Paste field and Go To Layout steps of the script when I import them into another file. Similar changes are necessay for the Set Field based scripts.

I want to create a global field on a developer layout to set the field for my Set Field and Paste steps similar to how I would use GetField( ) set up a quassi-dymanic lookup field.

In my PO database, I want the scripts to set a Date_Order field or a Date_ETA field, in a Project database, I want the scripts to set a Date_ContractComplete field, and in a personal Contact database I want them to set a Date_Birth field.

Any thoughts on how to use a g_SetField glabal to be picked up in a script to prevent changing 37 scripts to set one field in a file?

Or better yet not have to import the script into the current file using only one script with three variables to set the different fields?

Thanks

That was a hot topic among the community about programatically being able to specify which table occurrence and field you would like to set. Unfortunately this is not possible in v5 v6 or v7.

In 7 you could use the Script Parameter to go to the relevant sections of one script.

You might also be able to use the Set Field [ , calc] trick, where you use Go to Next Field and Set Field, without specifying a field, so that it operates on the currently selected one. You would put all the necessary fields on one layout and loop through them using Go to Next Field, setting them, and exiting the loop once a particular field or number of fields was reached.

  • Author

Thanks -Queue-,

I was thinking of a layout with only two fields, a constant field and the field I wanted to set; but, I was to embarrassed to mention it. It is not very dynamic if a layout change is required.

I used this...


If ["PatternCount( FieldNames( Status( CurrentFileName) , Status( CurrentLayoutName) ) , gInsertField )"]

[color:"white"]__[/color]Loop

[color:"white"]____[/color]Go to Next Field

[color:"white"]____[/color]Exit Loop If ["Status( CurrentFieldName ) = gInsertField "]

[color:"white"]__[/color]End Loop

[color:"white"]__[/color]Paste [select]

Else

[color:"white"]__[/color]Show Message ["The destination field is not available on this layout."]

End If

Exit Record/Request

It also works with Set Field [], but this application calls for Paste [].

Thanks

You shouldn't be embarrassed at all. That's a very decent workaround, especially if InsertField is a global into which you are setting the name of the field to find. It's very dynamic. Since the field has to be on the current layout anyway, the only advantage in using Set Field over Paste or an Insert function is that it may be faster.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.