Study for the Salesforce Platform Developer Exam. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Practice this question and more.


How should Invoices and Accounts be related to ensure that all Invoices are visible to everyone with access to Account?

  1. The Account should have a Lookup relationship to the Invoice.

  2. The Invoice should have a Master-Detail relationship to the Account.

  3. The Account should have a Master-Detail relationship to the Invoice.

  4. The Invoice should have a Lookup relationship to the Account.

The correct answer is: The Invoice should have a Master-Detail relationship to the Account.

The best approach to ensure that all Invoices are visible to everyone with access to the Account is to establish a Master-Detail relationship between the Invoice and the Account. In a Master-Detail relationship, the detail (Invoice) inherits the sharing and security settings of the master (Account). This means that if a user has access to the Account, they will automatically have access to all related Invoices, fulfilling the requirement for visibility. Additionally, a Master-Detail relationship creates a more structured association where the Invoice cannot exist without the associated Account. This is particularly useful for maintaining data integrity, as it ensures that no invoice is created without a corresponding account. If an Account were to be deleted, all related Invoices would also be deleted, which supports data consistency. This relationship type is ideal for ensuring comprehensive visibility, as it integrates tightly into Salesforce's sharing model, ensuring that the invoices are only accessible to users who have the appropriate permissions on the Account object.