AnsweredAssumed Answered

populating data from one table to another using set field

Question asked by BarbaraSevde on Jan 11, 2012
Latest reply on Feb 20, 2012 by BarbaraSevde

Title

populating data from one table to another using set field

Post

This is for a solution for a farrier.  I originally had the barn contact fields as part of the owner contact table (like you might have a shipping/billing address,) and showing in a tab in the owner contact layout.  I successfully used a script to populate the barn info identical to the owner info using only set fields in the script. 

 

However, a situation has come up that an owner has several  horses at 3 different barns. So I decided to make a separate table named Barns, and related barns to horses (one to many.)  Horse are already related to owners (many to one.)  

I would like the option, during data entry, to use the owner contact info to make a new record in the barn contact layout (as some owners simply have horses on their own property.)  I don’t need the relationship  between owner and barn for reporting purposes.  

      I tried modifying the same script I used in the original solution, but added

Go to layout ( Barns)

New Record /Request

      then continued with set fields 

Set Field[Barns::Name_Barn; Owners::Name_Full_First_First_Name]

Set Field[Barns::Address_Barn_Street; Owners::Address_Street]

      etc.

When I run the script, it goes to the layout, enters a new record, but the fields don’t populate. 

I thought maybe I need a direct relationship between Barn ID and Owner ID, so I added another field occurrence Owners 2, with _kp_owner_ID related to _kf_owner_ID and changed the Owners to Owners 2 table as the source in the set fields.  That also didn’t work.  

Anyone know what why this is not working? What am I missing?

Outcomes