You need to sign in to do that
Don't have an account?
v j
how to write apex class to create user sharing rule ?
Needed info on creating User Sharing Rule .In my code trigger written after insert on custom objects record which creates public group and shares that record in that group. Now i wanted to write a User sharing rule for same public group. I am not able to do that.
Here is the sample code to get started:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_creating_with_apex.htm
Thanks,
Pratik
I have gone through above link, i am looking for different thing not the record sharing. I want to create the " User Sharing Rule " under Setup/Admin/Security Control/Sharing settings .
Is it that you are not able to locate the Public user group in your sharing rule? Have you checked if that public user group is there in the Public Groups list as to verify if the group got created in the system.
Thanks,
Pratik
But problem is yet not solved when i use usermembershipsharingrule object i get compile error "Error: Compile Error: No access to entity: UserMembershipSharingRule at line 1 column 8"
error is due to line
Usermembershipsharingrule obj = new Usermembershipsharingrule();
Is anybody have idea why is this error ?
Try using UserShare object.
https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_usershare.htm
Let me know how it goes.
Thanks,
Pratik