Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I may be the biggest dummy around but... I have more problems getting the set field script to work. Are there some special rules which I am not aware of which aren't listed in the manuals and tutorials? I know I have to have a relation between tables to use it between two tables, but my calculation never ever gets placed in the field it's supposed to set! They are both number fields, no other relations, no other validation. This is driving me crazy! confused.gifconfused.gif

Posted

Perhaps you could elaborate and give some specific examples of your problem. The basic use of Set Field is fairly simple Set Field [fieldtoset; fieldorcalculationortext].

Posted

Ok..I have two different tables

NewDesign & Rooms

The new design table has an autoserialized field (designser_pk). I need to get the current # in that field and place it in the corresponding field (designser_fk) in a layout on the rooms table so that the rooms are tied to the serial number created in the other table. I made a script which

Go to Layout-New system design

Perform find

sort records

go to last record

set field [rooms::designser_fk; Newdesign::designser_pk]

go to layout room_layout

based on my figuring that should place the last records value from newdesign designser_pk into the rooms designser_fk field shouldnt it?

Posted

Yes, but it will place it in the first related record's field, based on how rooms is related to Newdesign.

Posted

If rooms is related to Newdesign based on pk to fk, then there would appear to be no related record when you're setting the fk.

Usually what you want to do is set the parent key in a global. Then you go to the other table, create a new record, and set the foreign key with the global's data.

Posted

hi joe - instead of using a find in your script, try using the get related field step and choose the relationship you've specified between the two files. Set up a new script and test it first by just specifying that step, then checking the results in the other file. hth.

Tony

Posted

Hey Tony. Thanks for the input but I don't have a get related field step in my scrpts. I have get related record but it doesn't seem to let me specify a certain field. Am I looking in the wrong area?

Posted

Go to Related Record is the step, but I don't see how it would help you in this situation. You are showing all records and then finding and setting the most recent one's data to a (currently) non-related table.

Posted

Hmm, I was getting from his first post that the tables were related. Is that right, Joe?

Tony

Posted

<Reread thread> I see now what you meant - the first two tables ARE related and you're trying to relate the other table to that same key. You need to do what -Queue- said below.

Usually what you want to do is set the parent key in a global. Then you go to the other table, create a new record, and set the foreign key with the global's data.

Tony

This topic is 7435 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.