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.

Go To Field ScriptStep by Calculation or Variable?

Featured Replies

I am writing a script that I need to use the "Go To Field" is the fieldname specified in a global $$Fieldname variable? Any ideas? Perhaps there is a different scriptstep that I should be using? :B

Could you give more information? How about using Go to Object?

  • Author

I am trying to collect data from a user to be inserted into the field that they specify. So an example might be that the user chooses "Field A" to have "Company XYZ" data entered into "Field A". This "Company XYZ" would be entered into "Field A" for all of the records in the current found set. Does that help?

what's the reason they are not entering directly into the fields?

  • Author

The idea is to automate some of the data entry that we are currently doing. One set of project specific records can be up to 700 entries. Of course there may only be 30 recordes that need "Company XYZ" entered into "Field A". And the next set of data that needs to be entered may be "3/12/08" into "Field B" for 15 records. Many of my users are Excel proficient and love the Ctrl+D function for data entry.

To expand on what _henry_ said, use Go to Object rather than Go to Field.

On your layout, use the Object Info palette to give the fields object names that correspond the values that the user can select (e.g. "Field A").

In your script use Go to Object and then Set Field, but DON'T specify which field. The value will then magically go to the current object (i.e. the chosen field).

  • Author

Thank you!!!!

If you have a found set, why not just use the [color:blue]Ctrl + = Keyboard short cut, for Replacing the contents of a field. This replaces the field contents in whatever field selected, with the content of that field for all of the records of the found set.

Lee

Edited by Guest

  • 2 months later...
  • Newbies

So, I also would like to perform get/set operations on dynamically specified fields. It seems that the only way to dynamically reference a field is via its Object Name. Of course, I haven't set any Object Names in advance, so I was thinking of writing a script to loop through each field on each layout and set its Object Name to be the name of the field.

Problems are: 1) there's no script step to SET an Object Name, and 2) there's no way to go to the (arbitrarily) "first" field on a layout in order to loop through with Go To Next Field. Are both of those statements correct?

Thanks a bunch,

FMP24060

1. No, of course not - how would you specify which object to name?

2. Go to Field[] followed by Go to Next Field will go to the first field in the tab order of the current layout.

  • Newbies

1. No, of course not - how would you specify which object to name?

Why, hypothetically you would set the name of the *current* object by not specifying which object. In just the same way as we Set Field[] above without specifying which field, in order to operate on the current field. This would be useful when looping through each field object in turn.

2. Go to Field[] followed by Go to Next Field will go to the first field in the tab order of the current layout.

Great, thanks for this... Just for sake of completeness, how would you tell when you've gone past the last field?

1. Yeah well, hypothetically... Speaking practically, naming an object is a layout modification, and there are no script steps that allow that - not even Enter Layout Mode.

2. See if this helps:

http://www.fmforums.com/forum/showtopic.php?tid/185471/post/244630/#244630

Note that I am not recommending this technique (rather the opposite). Also, it requires that there be only one instance of the first field in the tab order of the layout.

The bigger issue is that scripts don't work in layout mode.

Set Field dynamically is an oft requested function. Object works ok, but it would be great if FMI included the functionality. Keep your fingers crossed.

Edit: comment beat me again. I've got to stop sitting on my posts.

Edited by Guest

Excuse me for replying with propaganda, but this does exactly what you want (and what I have been dying for over years :) : http://www.bh-a.com/fmxlayoutassistant/

Still available at special rate after the French FM Conference.

Demo file and video available on web site.

Edited by Guest

  • 7 years later...
  • Newbies

I've found an alternative, if possibly not ideal, way to solve this problem on Brian Dunning's custom functions, which works if you have a Mac:

https://www.briandunning.com/cf/1240

The custom function basically concatenates an apple script that selects the desired field. I've put the function in a variable and then placed the variable as the calculation result of a Perform AppleScript script step, and it works like a charm! 

Create an account or sign in to comment

Important Information

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

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.