joemacgruder Posted September 20, 2004 Posted September 20, 2004 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!
-Queue- Posted September 20, 2004 Posted September 20, 2004 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].
joemacgruder Posted September 20, 2004 Author Posted September 20, 2004 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?
-Queue- Posted September 20, 2004 Posted September 20, 2004 Yes, but it will place it in the first related record's field, based on how rooms is related to Newdesign.
joemacgruder Posted September 20, 2004 Author Posted September 20, 2004 Thats just it, even when there is only 1 record it still won't show up.
-Queue- Posted September 20, 2004 Posted September 20, 2004 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.
Tony O Posted September 20, 2004 Posted September 20, 2004 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
joemacgruder Posted September 21, 2004 Author Posted September 21, 2004 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?
Tony O Posted September 21, 2004 Posted September 21, 2004 Sorry, yes, get related record is the step you need. T
-Queue- Posted September 21, 2004 Posted September 21, 2004 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.
Tony O Posted September 23, 2004 Posted September 23, 2004 Hmm, I was getting from his first post that the tables were related. Is that right, Joe? Tony
Tony O Posted September 23, 2004 Posted September 23, 2004 <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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now