function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SamCalvoSamCalvo 

Lookup relationship

I am creating a demo for an interview and I have to create custom fields for Accounts, Contacts and Opps, 2 fields per object.

1 of the 6 custom fields has to be a Lookup Relationshop. I know how to do this technically, however when I do it I find it redundant since in the Lookup relaitonship I have to chose a standard object and all standard objects seem to already be linked. Am I missing something.

For example, I can create a custom Lookup relationship field in Opportunity and pick a Contact. But there is already standard functionality that does that.

Please advise
Dan1126Dan1126
Hi scal,

This is kind of a vague question. It really depends on what the requirements are for whether or not lookups among these standard objects would be appropriate. You're correct that they are all linked via standard functionality, but sometimes you would need to do something additional. For example, what if you wanted to track opportunity referrals -- i.e., customers referring other customers which are logged as opportunities? In that case, the standard Account field on Opportunity would link to the customer, and you could make a custom lookup field to Account to link to the Referral Account. In this case you'd have two relationships, both of which serving unique and important purposes. 

In your example, I guess it depends on the reasoning they need that relationship created. Yes, the OpportunityContactRole junction object should probably work for the purposes of associating Contacts and Opportunities, and it is always better to use the standard functionality where possible. Perhaps you could explain that in your answer? I would be impressed if the interviewee could explain that satisfactorily. 
prayank sahu 7prayank sahu 7
Please go through the below links for more detail about relationship in salesforce

https://youtu.be/9ltnHYQ1tqE
https://youtu.be/3ULokr4yaEE