In Earlier release, we have given record access via apex managed sharing. In new release we have removed the apex managed sharing, in place we have used object sharing rules. My question is during deployment the sharing rules to other sandboxes, whether the existing apex managed sharing records are deleted or not as part of sharing rules recalculation??

  • After deployment you can do the recalculation from Sharing Settings. Jul 20, 2016 at 17:54
  • We have recalculated the sharing settings for that object, still old sharing records (RowCause=Manual) exists in the share object
    – Nani
    Jul 20, 2016 at 17:56
  • So, you can remove that entries from the object Jul 20, 2016 at 17:57

1 Answer 1


If the records are created via apex sharing ,then then system does not delete it as a part of recalculation .

If you had custom RowCause defined then its easy to query the table and delete those records else those record may show with rowCause Manual and it might confuse you if user has also manually shared via manual sharing button .

The only way would be to explicitly delete those records via developer console .

  • we deleted the existing one's by SOQL query in PROD. But the thing is when the changes are deployed first time to fully copy sandbox we don't have any issues but next time deployment we faced issues with the sharing records. Earlier version apex sharing records still exist in the sandbox. How come these are created all of a sudden which are not in earlier??
    – Nani
    Jul 20, 2016 at 18:30

You must log in to answer this question.

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