Jump to content

Go To Field ScriptStep by Calculation or Variable?


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

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

  • 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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

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

Link to comment
Share on other sites

This topic is 2027 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
 Share

×
×
  • Create New...

Important Information

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