Brian12568 Posted July 23, 2006 Posted July 23, 2006 (edited) i might be simple asking this but im kinda new to filemaker. i am setting up a DB all going ok ish but for some reason this part is not working ok i hear you saying get on with it. 2 tables in questions one is a address other is a contact it has a relationship address table contact table address has a auto field 'ID' index key contact table is linked via field called custID it is a 1-many however when i try to create a contact & relate it to an address the ID doesnt populate the custinfoID field? currently script, i have it check if there is already a contact exsisting IF custinfoID is null then create a new contact but it doesnt populate the custID field to relate thecontact with the address. IF[isEmpty (callDetails::custinfoID)] new window ...... go to layout ..... new record set field [customerinfo:ID; (contactdetails:custinfoID)] End if What am i missing? Thanks for any help in advance Brian Edited July 24, 2006 by Guest
LaRetta Posted July 23, 2006 Posted July 23, 2006 Hi Brian, Grab the ID before you head off to the related table. You've mixed names and ID fields and I'm not exactly clear what you are creating but the idea is to start your script with something like: If [ IsEmpty ( callDetails::custinfoID ) ] Set Variable [ $CustID ; Contacts::CustID ] [color:blue]<--- grab the ID you need to use in the other table new window ...... go to layout ..... new record set field [customerinfo:ID; $CustID] [color:blue]<--- set the new record with the stored variable ID Else ... do whatever if the customer exists End if If someone doesn't have vs. 8, they can use script variables or globals to hold the value. LaRetta :wink2:
Brian12568 Posted July 24, 2006 Author Posted July 24, 2006 Cheers Bud i nearly had it before with a set var but surrounded the var $... in brackets when setting the field DOH :)
Recommended Posts
This topic is 6699 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