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

Salesforce limits using apex



Is there any way to get number of workflow rules, validation rules, assignment rules per object in org using apex?

Also, can we get number of portal roles, sharing rules per object using apex?




Hi Rupali,


You can get Limit of workflow rules, validation rules and sharing rules per object using following steps in your organizations.


1. Login to Salesforce organization

2. Go to setup

3. Go to Create --> Objects.

4. Click on Object Name.

5. Scroll Down and Find related list Named "Object Limits"


Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator


Hi Hitesh,


I am aware of Object limits. But, I want to access these limit values using apex.



Bhawani SharmaBhawani Sharma
Nope, I don't think so.

Through apex, you may not be able to get the limits and counts of those rules.


If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.


Yoganand GadekarYoganand Gadekar

You may go through this documentation for metadata related info for workflows