In Salesforce, relationship fields are always created on the child (many) side of the relationship — the object that holds the foreign key pointing to the parent. The field stores the parent record’s Id; the parent object is the “Related To” target. Where you put the field determines what’s child and what’s parent.
The rule
The “many” side gets the relationship field. The “one” side gets the related list automatically.
For a 1:N like Account ↔ Opportunity, you create the lookup field on Opportunity (the many side, the child) pointing to Account (the one side, the parent). An “Opportunities” related list appears on the Account page layout for free.
Why this matters
Imagine the wrong direction: if Account had a “Lookup to Opportunity” field, each Account could store one Opportunity Id. That would make every Account → exactly one Opportunity (or null). That’s not what you want — you want each Account to have many Opportunities. Putting the field on Opportunity gives you exactly that: many Opportunities, each pointing to one Account.
Step-by-step creation (Lightning)
- Identify which side is many. Ask: “An A has many of which other object?” → that other object is the child.
- Navigate to Setup → Object Manager → [Child Object] → Fields & Relationships → New.
- Select Lookup Relationship or Master-Detail Relationship.
- Pick the Related To object — this is the parent.
- Field Label / Name — describes the parent from the child’s perspective (e.g., “Account” on Opportunity).
- Field is required? Lookup filter? — configure.
- Set field-level security per profile.
- Choose which page layouts the field appears on.
- Set the related list options on the parent — the label users see (“Opportunities”), columns to display, sort order, buttons.
- Save.
What gets created
You actually get two things for the price of one:
- A new field on the child object (the foreign key)
- A new related list on the parent object’s page layout (the children-of-this-parent view)
The related list uses the field’s child-relationship name. You set that name during creation — for Opportunity.AccountId, the child relationship name is Opportunities, which is how SOQL accesses children:
SELECT Id, Name, (SELECT Name, Amount FROM Opportunities)
FROM Account
Many-to-many is the same rule applied twice
For a many-to-many like Student ↔ Class, you create a junction object (e.g., Student_Class__c) and put two relationship fields on the junction — one to Student, one to Class. The junction is the “many” side relative to both parents. Each parent gets a related list back to the junction automatically.
Common confusion: “Where do I create a self-lookup?”
The same rule applies: the field lives on the object that “has many” of itself in the child position. For Account hierarchy, Account.ParentId is a self-lookup created on Account pointing to Account — Account is both parent and child here, but the relationship field is one column on the Account record holding the parent Account’s Id.
What you cannot do
- You cannot create a “Lookup from Parent to Child” — Salesforce doesn’t model relationships that way.
- You cannot create a relationship field directly on a standard object’s relationship metadata (you can add custom lookup fields to standard objects, but you can’t change how standard relationships like Account → Opportunity are structured).
- You cannot create a master-detail with a standard object as the detail in most cases.
Tip for interviewers’ favorite scenario
Q: “I want to roll up Opportunity Amount onto Account. How do I do it?”
A: You’d need a master-detail from Opportunity to Account so you can create a roll-up summary on Account. But Salesforce intentionally made Opportunity.AccountId a lookup, not a master-detail — Opportunity has its own owner/sharing. So out of the box you cannot use a roll-up summary; you’d use a flow, trigger, or DLRS (Declarative Lookup Rollup Summaries) AppExchange package instead.
That answer demonstrates you understand both the “field lives on the child” rule and why some natural patterns aren’t possible with master-detail.
Verified against: Salesforce Help — Custom Fields and Relationships. Last reviewed 2026-05-17.