You need to sign in to do that
Don't have an account?
grajan
Apex Managed Sharing Not Committed.
Hi,
I have a sharing trigger on contact object. While inserting the contact my trigger (After insert trigger) will sharing that contact with particuler user. Also I have a workflow field update to assign the owner of the contact based on the state.
Problem:
Case 1: If my inserted contact meet the workflow cretiria then my shared contact will not committing. (Without any error)
Case 2: If my inserted contact not meeting the workflow cretiria then my shared contact will get committed.
Question: Why the shared contact not committed while owner changed by workflow?
I have a sharing trigger on contact object. While inserting the contact my trigger (After insert trigger) will sharing that contact with particuler user. Also I have a workflow field update to assign the owner of the contact based on the state.
Problem:
Case 1: If my inserted contact meet the workflow cretiria then my shared contact will not committing. (Without any error)
Case 2: If my inserted contact not meeting the workflow cretiria then my shared contact will get committed.
Question: Why the shared contact not committed while owner changed by workflow?
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_creating_with_apex.htm
It is possible to manually share a record to a user or a group using Apex or the SOAP API. If the owner of the record changes, the sharing is automatically deleted.
Thus if your sharing rowCause is 'manual' (or undefined, as this is the default), then changing the owner will discard the sharing.