You need to sign in to do that
Don't have an account?
jlhmitchell
How is contact ownership defined (defaulted) when contact created by community user?
I have case-trigger based behavior that will assign a case team member to a case based on a value on a field (exposed and editable by community users). If a contact doesn't exist, the contact is created prior to adding to case team.
This works fine, unless the account owner of the community user is an inactive user. In that scenario, the contact is not created.
I have tried to set the ownerID of the contact on create, but debug is showing me that the failure is still occurring with
INACTIVE_OWNER_OR_USER, operation performed with inactive user [<Account Owner ID>] as owner of contact:
My suspicion is that salesforce defaults to account owner ID, but allows on creation a different value (I can verify that the ownerID I set for contact is otherwise used when on an account that is not owned by an inactive user).
Is there something I am missing? Does anyone have suggestions?
This works fine, unless the account owner of the community user is an inactive user. In that scenario, the contact is not created.
I have tried to set the ownerID of the contact on create, but debug is showing me that the failure is still occurring with
INACTIVE_OWNER_OR_USER, operation performed with inactive user [<Account Owner ID>] as owner of contact:
My suspicion is that salesforce defaults to account owner ID, but allows on creation a different value (I can verify that the ownerID I set for contact is otherwise used when on an account that is not owned by an inactive user).
Is there something I am missing? Does anyone have suggestions?
http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_general_audit_fields_inactive_owners.htm#rn_general_audit_fields_inactive_owners
All Answers
http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_general_audit_fields_inactive_owners.htm#rn_general_audit_fields_inactive_owners
I confirmed this by enabling the organization user permissions in sandbox, verified that a standard profile can now be granted the Update records with inactive owners, but a profile we use in community does not see this permission.
I've confirmed that the community user is the user in context while creating the contact record. My brain is stuck in a loop: I thought that contact ownership is defaulted to the user who creates the contact. It makes sense that portal/community users can't be the owner of a contact, but what is driving that the account owner defaults to be the owner? Why can't I force a different owner? I've even tried creating the contact without an account initially (with the thought I could update the contact to assign account after creation), but the owner still persists to be the owner of the account related to community user.
I also tried doing all of this as a lead and converting the lead (I can force ownership and existing account during lead conversion), but the community user cannot perform lead conversion (it also seems a convoluted way to get to the intended result).
By the way, our sharing settings for contact is "Controlled by parent" so perhaps THAT's the answer for why it adopts the account's owner. But that doesn't explain why I am unable to create a contact without an account relationship at all, yet the account ownership still persists.
Interestingly, this does seem to work BUT I can see on the contact record's chatter feed that the owner is being changed from account owner to pushed owner prior to the account being changed from null to the assigned value.
I halfway wonder whether the act of enabling the organization user permission caused different behavior. I didn't test after making that change because I was unable to assign the profile permission so assumed it made no difference.
I am going to move the code change to another sandbox and test the heck out of it. If the code change alone doesn't enable the behavior, I will also enable the organization user permission and see if that enables behavior differences.
I will report back my results either way.