function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Naveen KvpNaveen Kvp 

how to overcome sharing rules limit in enterprise edition ??

Hi everyone i have a requirement to create criteria based sharingrule. but edition limit 50 (enterprise) is exceeded how can i create sharing rule for account object.For this account OWD is set as private!! give me some valuable suggestions or ideas..!!
PratikPratik (Salesforce Developers) 
Hi Naveen,

If you are sharing the same set of records to different roles in each sharing rule, then you can create the Public Group and combine those roles under Public group.

Also if you want to increase the limit of sharing rules you can contact Salesforce support.

Thanks,
Pratik
Naveen KvpNaveen Kvp
By using customozation we can achieve this or not??
RavitejaRaviteja
Yes we can do using Apex sharing,

Ex:  Job__c is an object.

    // Set the ID of record being shared.
      jobShr.ParentId = recordId;
       
      // Set the ID of user or group being granted access.
      jobShr.UserOrGroupId = userOrGroupId;
       
      // Set the access level.
      jobShr.AccessLevel = 'Read';
       
      // Set rowCause to 'manual' for manual sharing.
      // This line can be omitted as 'manual' is the default value for sharing objects.
      jobShr.RowCause = Schema.Job__Share.RowCause.Manual;
       
      // Insert the sharing record and capture the save result.
      // The false parameter allows for partial processing if multiple records passed
      // into the operation.
      Database.SaveResult sr = Database.insert(jobShr,false);

Thanks,
Raviteja