Skip to main content
please help, what should be the relationship between Bank, branch, Account object? where

 

1. A bank can have many branches and any branch cannot exist without a bank.

 

2. A branch has many accounts and an account cannot exist without a branch.

 

3. An account can be shifted to any other Branch
1 resposta
  1. 1 de mar. de 2021, 12:29
    Hi Pradeep,

     

    To answer this question, you need to understand the difference between Master-Detail and Lookup relationships. Some of the things M-D does that lookups don't are:

     

    1. The relationship is always required

     

    2. The record loses its "owner" field - a child record is always owned by the owner of its parent

     

    3. Deleting the parent record also deletes any child records

     

    4. You can still move a child record to another parent by selecting the Allow Re-parenting option in the field definition

     

    With these in mind, I would suggest that the relationship between Bank and Branch is a Master-Detail relationship. Branches have no reason to exist without a bank, and deleting the bank should delete all branches of it.

     

    However, the relationship between Branch and Account should be a Lookup. I would argue that item #2 - the lack of individual owner on the child object - would cause a problem. Accounts should have individual owners that are not necessarily the owner of the entire bank.