extreme Posted December 16, 2020 Posted December 16, 2020 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
Wim Decorte Posted December 16, 2020 Posted December 16, 2020 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.
extreme Posted December 16, 2020 Author Posted December 16, 2020 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
bcooney Posted December 19, 2020 Posted December 19, 2020 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
extreme Posted December 20, 2020 Author Posted December 20, 2020 Thank you bcooney I have this but again I'm stumped
Recommended Posts
This topic is 1432 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