February 5, 200817 yr 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
February 5, 200817 yr 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?
February 5, 200817 yr 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.
February 6, 200817 yr 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).
February 6, 200817 yr 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 February 6, 200817 yr by Guest
April 12, 200817 yr 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
April 12, 200817 yr 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.
April 12, 200817 yr 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?
April 12, 200817 yr 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.
April 12, 200817 yr 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 April 12, 200817 yr by Guest
April 12, 200817 yr 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 April 12, 200817 yr by Guest
April 8, 20169 yr 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