Jump to content
Server Maintenance This Week. ×

Dynamic Set Field


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

Recommended Posts

It would be really powerful to be able to dynamically define the field in which you want to set a value. I.E Set Field (script parameter) or (Variable). At the moment the only option is to hard code the field that you want to set a value in although you can dynamically choose what value to set.

Link to comment
Share on other sites

It would be really powerful to be able to dynamically

Perhaps, but what would you use it for? Fields do hardly exisist freely anyway, they're always structurally defined to a context, where a Else if structure in the script, won't be too nested if the data is just a hint normalized.

When it comes to it should most of the scripting power go towards the keyfields anyway???

--sd

Link to comment
Share on other sites

No I have heard it from time to time as well, without really seeing the point in it.

You should consider the GetField( command in an unstored field instead of actually setting fields in my humble opinion.

Another thing where you admittingly approach things upside down, is to use the lookup( function, and exploit chains of "if fail" values.

--sd

Link to comment
Share on other sites

In FileMaker 8.5 you can name an object on a layout (manually), then Go To Object [ name, or calculation ]. Then use Set Field [ ; "whatever ]. That is, use Set Field with no target field. The field has to be on the layout however, and you have to name it (in Object Info). But it sure beats looping through all the fields until you hit it.

Link to comment
Share on other sites

Hi

The situation where I would use this is in a fast find script where I have a single global field that the user enters a find paramenter and then it searches in fields which can be selected from a list. The List may contain First Name, Last Name, Address. The script would enter fiind mode, set field (first value from list) with data from the global, add new request, set field (Second value from List) etc. Once it reached the end of the list it would perfom the find. I do this now but have to have a layout with the fields I want to search and use the goto next field in a loop to make it work. The downside of this is that it requires an extra layout, the fields have to be on that layout and is not easy for users to have there own set of fields to search.

Link to comment
Share on other sites

Hi Søren

Thanks for the file. I like the way you have made the selection of the fields to search from the checkbox list. If you could go setfield($which) to SearchValue it would be perfect. The way I have done this uses the extra layout but you do not need to name the fields you want to search in the script. You win some you lose some!!

Link to comment
Share on other sites

My stab at it were purely to avoid the dependancy of the layout which might or might not be underneath, which was they problem you wish address by putting a variable in the desitnation field.

You can in my template remove the fields appearance if you wish! My point is that with fully normalized structures isn't the scripting going to much time since the chances are that a lot of fields would be broken out in related tables, eventhough they might be of very different nature could they easily go to the same!

Take a look at "Tiered Tables (Multipurpose Tables) " in http://www.foundationdbs.com/Downloads/WhitePaperForFMPNovices.pdf

Or Watch this video:

http://previews.filemakermagazine.com/videos/513/DataTagging_full.mov

What this does is that searches becomes pretty uniform, always two fields, today with GTRR(FS) is it easy peicy to get from the found set to a matching set of parent records.

So your request is more urgent to flat file systems than normalized systems. I would make seaches in a broken out table if the solution could be deployed on fm8+

--sd

Link to comment
Share on other sites

This topic is 6499 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
×
×
  • Create New...

Important Information

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