You need to sign in to do that
Don't have an account?
Lee Sin
Criteria based sharing rule
I want to programmatically change the Criteria based sharing rule on Account.
After read the material, I found nothing.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_creating_with_apex.htm
I want to change the criteria through apex or enable/disable a sharing rule through apex.
My scenario:
I want to open certain accounts to users for them to work on. When a goal is reached, the manager can click a button to hide the accounts from the users. And when the next month comes, the manager clicks a button to enable the sharing rule.
After read the material, I found nothing.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_creating_with_apex.htm
I want to change the criteria through apex or enable/disable a sharing rule through apex.
My scenario:
I want to open certain accounts to users for them to work on. When a goal is reached, the manager can click a button to hide the accounts from the users. And when the next month comes, the manager clicks a button to enable the sharing rule.
You can create sharinf through Apex sharing all together rather than modifying the existing rule. You can delete the existing rule and create apex sharing to share the records as per the criteria.
You can refer to:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_creating_with_apex.htm
for sharing accounts:
https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_accountshare.htm
Thanks,
Pratik