July 23, 200619 yr 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, 200619 yr by Guest
July 23, 200619 yr 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:
July 24, 200619 yr Author Cheers Bud i nearly had it before with a set var but surrounded the var $... in brackets when setting the field DOH :)
Create an account or sign in to comment