0

Custom object child record is created "Deal__c" alongside with the following field values which are all mandatory:

  • Master-detail to Account (Account: OWD-Public Read)
  • Lookup to Opportunity (Oppty: OWD-Private, has field Lookup to Account),
  • Lookup to OpportunityTeamMember (OpptyTeam: OWD-Controlled by Parent, has field Master to Account)

Receiving the error above when creating the child Deal record when using a master Account that is owned by another user. No error if the Deal creator is also the Account creator.

  • Profile creating the deal record has CRU access on all Account, Deal, Opportunity, OpportunityTeamMember.

Can I get some insights? Thanks

2
  • Are they the owner of the account? If not, what is the security setting on the relationship? Is it a minimum level of Read? Grasping straws here as security and this error specifically are tough to diagnose without being in the instance.
    – Eric
    Jun 29, 2017 at 23:39
  • I edited the question, my bad for insufficient info. Account being used as master is owned by another user. Account has minimum of public read and master to Deal so Deal's security settings is controlled by parent. Jun 30, 2017 at 0:10

2 Answers 2

0

The person creating the deal record , where are they in relation to account owner in the Role Hierarchy. Please try if you are getting the same error if the user creating the deal is at a higher level in the role hierarchy to the owner of the Account. If not getting the same error , then you may need to create sharing rules to fix this issue.

4
  • I just read on the documentation that on Master-Detail, the detail record's owner automatically becomes the owner of the Master so whoever created the child, is no longer relevant because the owner will always be the owner of the master. I'm not sure if it has something to do with that because i thought when you create a record, its automatically yours no matter what because you have record ownership which is the fullest permission. Anyways thank you i think this question can't be simply answered directly because of several factors that have to be considered. Jun 30, 2017 at 3:46
  • What you have mentioned is correct , but since the issue is not with the owner of the account , or the owner of the deal record (in this case because of master detail will be the account owner) , but with another user. It comes down to sharing . ie: the other user needs access this can happen either by providing write access through OWD or inheriting access through role hierarchy or sharing rules Jun 30, 2017 at 4:31
  • Just an update to help other too. I created a before insert trigger that will create an AccountShare object and give Edit access automatically to the Deal creator. I have a theory im not sure though, that since Deal inherited the Master's OWD(public read), it is not enough since deal creator will eventually modify the Deal ownership (transfer from Deal creator to Account Master owner) so its not possible if its Read only. So granting the Edit access on account, in turn grants edit access on Deal record, which then transfers ownership to the master account's owner. Bit confusing but makes sense Jul 3, 2017 at 22:20
  • Also FYI, classes I used are "With Sharing" so OWD applies and not system context. Jul 3, 2017 at 22:23
0

Maybe: settings on Deal__c > account__c should be > Read Only: Allows users with at least Read access to the Master record to create, edit, or delete related Detail records. not > Read/Write: Allows users with at least Read/Write access to the Master record to create, edit, or delete related Detail records.

Read/Write is the default value, so please check it out.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .