Title
Recording Client Correspondence
Post
I have followed a few of the forum posts about setting up Client Correspondence tables. I am very close to making it all work but I have a couple of challenges. I have created a portal to view the correspondence and I can see the sample data that I manually input into the table (Correspondence). I have created a script to allow me to create a new Correspondence record. However, it is not bringing the client primary key or the Correspondence Primary key into the table (ClientCorrespondence) that links the Clients table with the Correspondence table. The Script is also taking me directly to the table to add a new record. Is it possible to add the new Correspondence record from the portal on the clients contact layout?
This is the script I have setup:
Enter Browse Mode []
Set Variable [$ID; Value:Clients::__pkClients]
Go to Layout ["Correspondence" (Correspondence)]
New Record/Request
Set Field [Correspondence::_pkCorrespondence]
Go to Layout ["Correspondence" (Correspondence)]
Go to Field [Correspondence::SentVia]
Attached are the relationships between the Clients, ClientCorrespondence and Correspondence tables.
Thanks in advance for any help.
Scott
Nothing in your script is creating a new record in the ClientCorrespondance table to establish a link. If you are creating a new correspondance record, your script needs to create new records in both of these tables before your portal on the Client table can access that new record.
#Script should only be run from layouts based on Clients
Freeze Window
Set Variable [$ID; Value:Clients::__pkClients]
Go to Layout ["Correspondence" (Correspondence)]
New Record/Request
Set Variable [$CorrID ; Correspondance::__pkCorrespondence]
Go to Layout ["ClientCorrespondence" (ClientCorrespondence)]
New Record/Request
Set Field [ClientCorrespondence::_fkClients ; $ID]
Set Field [ClientCorrespondence::_fkCorrespondence ; $CorrID]
Go To Layout [Original Layout]