3

I was going through a set of questions for Salesforce Certification and the below question is something where I would like to verify my answer.

Question: A company has a custom object named Warehouse. Each Warehouse record has a distinct record owner, and is related to a parent Account in Salesforce. Which kind of relationship would a developer use to relate the Account to Warehouse?

Options:

  • Parent-Child
  • Master-Detail
  • Lookup
  • One-to-Many

I thought the answer as Lookup, but it is telling me the correct answer is: One-to-Many. What do you think? I don't think we have any One-to-Many relationship in Apex?

Ref: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/relationships_among_objects.htm

  • The certification is telling you that One-to-Many is correct? Or just a study guide? – sfdcfox Nov 25 '16 at 20:54
  • @sfdcfox I was going through a mock quiz and there it wss telling this answer. Which seems wrong to me. – Sudipta Deb Nov 25 '16 at 20:56
  • Was it a SFDC mock quiz? If so, can you share the link? If it wasn't a SFDC mock quiz, I wouldn't bet on the answer being right, despite sfdfox's answer. – Sebastian Kessel Dec 14 '16 at 20:32
5

The test writers are looking for the Account's relationship to the Warehouse, not the Warehouse's relationship to the Account. That means you have to plug in each word to determine which correctly describes the relationship. Examine the following four sentences.

The Account has a Parent-Child relationship to the Warehouse.

The Account has a Master-Detail relationship to the Warehouse.

The Account has a Lookup relationship to the Warehouse.

The Account has a One-to-Many relationship to the Warehouse.

Clearly, since many Warehouse records can belong to a parent Account, both Lookup and Master-Detail are immediately eliminated.

The remaining two choices, Parent-Child and One-to-Many are actually opposites. This is because hyphenated relationships like Parent-Child and Master-Detail refer to the "other" object first, then to the object in question. For example, we often say the following:

The Warehouse has a Parent-Child relationship to the Account.

The Warehouse has a Lookup relationship to the Account.

The Warehouse has a Master-Detail relationship to the Account.

The only choice left is where we have One-to-Many:

The (One) Account has (Many) Warehouse records.

This question is intentionally deceptive by mentioning things like Ownership, which from the Account's perspective, doesn't matter. Unfortunately, this type of question is one of those that you'll want to think about carefully and re-read a few times. Certification questions sometimes require a bit of lateral thinking, such as what you'd have to do if you were an actual developer.

  • 1
    This is great explanation! – javanoob Nov 26 '16 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.