0

We want to track the deleted records in OpportunityShare Object for some reason.

This object doesn't support to write a trigger.

Is there way to track those deleted records?. Any suggestion would be appropriated.

Additional Information : Our requirement is - we have a custom object from managed package which has an lookup relationship with Opportunity. We have placed the custom object as a related list under opportunity. Opportunity is shared with different users via role, sharing settings, account team, oppty team, manual sharing.

Exception: User who is having an access to opportunity should get an access to custom object records.
Since the oppty records are shared in many ways with users , we can not go and write trigger on each of those to give an access to custom object. Instead we are trying to copy the OpportunityShare records to CustomObj_Share object so that custom object get the same access of opportunity.

We have tried so far : We are able to copy the records from OpportunityShare to CustomObj_Share by scheduling apex class to run the copy logic.

Issue is : We are unable to track the deleted record information from Opportunityshare when we revoke the access. Due to this we cannot revoke the Custom object access based on opportunity.

3
  • This is an X-Y Problem. Namely, there is no way to track deletions or share objects short of replicating the entire table periodically and checking the delta. There may be another solution, but it depends on what your X is.
    – sfdcfox
    Sep 28, 2019 at 22:04
  • Thanks!. I have updated our requirement in the above question. Please check it out. Let me know if you have any question.
    – user51204
    Sep 29, 2019 at 4:57
  • Is it good idea to get the deleted opportunityshare information from Recycle Bin using SOQL then delete the customobj_Share records?
    – user51204
    Sep 29, 2019 at 5:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.