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

  • 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 '17 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. – Jefferson Fernandez Jun 30 '17 at 0:10
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.

  • 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. – Jefferson Fernandez Jun 30 '17 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 – Clint D'Silva Jun 30 '17 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 – Jefferson Fernandez Jul 3 '17 at 22:20
  • Also FYI, classes I used are "With Sharing" so OWD applies and not system context. – Jefferson Fernandez Jul 3 '17 at 22:23

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.