December 16, 20205 yr Hello I have a dilema whuch I have been trying to work out I have hunted for a solution but with no Joy. I have a table for Contacts and a Table for Companies which is joined via a relationship. I have been trying to create a script that if the Contact does not belong to a company then the project in the Contacts Name or if the Contact belongs to a Company then Create the project with the Company name. I have tried with else and els if but with no joy. As anyone have a script for this to work for me. Thank You
December 16, 20205 yr Kinda depends on how you set up the relationship between Contacts and Companies. If you're working off the assumption that one contact can only belong to one company then you probably have a company id field on the contact record. As soon as you select the contact on your project, I'm going on the premise that you store the contact ID and thus have a valid relationship from project to contact. (Doesn't need to be so but it changes how you'd check for the contact's company id) Then at the point in your script where you decide on the project name you do an IF that checks if the company id field on contacts is empty: use the contact name, else (meaning the contact does have a company id populated) use the company name.
December 16, 20205 yr Author Hello At first I had the contact and the company name field in the same table but I couldn't work out how to create the script. So then I added the Table for the Company and joined the relationship I have attached the images of the relationship I have created I would prefer that the Company Name and Contact Name would be in the same table then if no cCompany as been added then it creates it in the Contacts Name. Thank You
December 19, 20205 yr Wim is keeping it simple, since you list your level as beginner. However, there is a way to achieve contacts and companies in one table. It’s typically referred to as the party model. More here https://support.claris.com/s/article/adv007---data-modeling-that-scales---dave-graham?language=en_US
Create an account or sign in to comment