Header Ads Widget

Manual Sharing issue ||interview stuff || SFDC


Manual Sharing issue


Issue: We have faced the issue on sharing access whenever we click on recent item.

Technical Description:

   We have two records and link is in visual force page when we click the any record than record will populate fine. However when we click on Recent Item of record it will show “Inefficient Privileges” error message page.

Technical Solution:

   We analyzed the record Standard Button ‘View’ overridden functionality and sharing access to this user. Finally we got the issue in manual sharing access which is given by code. We are passing the sharing to record on after update trigger however we are just inserting the record that’s why it will show me “Inefficient Privileges” error message page.

    So we have updated the record and give the sharing through code.

Trigger of sharing on Sales object:

trigger setAccessSSR on Sales__c (after update) {

 for(Integer i=0;i<Trigger.new.size();i++){

       request = Trigger.new[i];   

    try

{

       Sales__Share share = new Sales__Share();

       share.ParentId = request.Id;

       share.AccessLevel = 'Edit';

       share.UserOrGroupId=request.OwnerId;

 insert share

} catch(Exception e){}

   }//end of for loop

}// end of trigger

Post a Comment

0 Comments