Finding Required Fields on Salesforce Objects – Which Tool to Use?

A data architect on my team recently asked me if I could get him a list of universally required fields from the Account object. The easiest way was to click into each field, check if it’s required and accordingly add it to the list. What’s the fun in doing that, right? So I scourged the Salesforce stackexchange and Developer forums trying to find code which would utilize the DescribeSObjectResult class for querying the needed metadata. I found enough to come up with a code snippet that can be executed as Anonymous Apex and the resulting system debug would provide us with the list of required fields.



System Debug Result

System Debug Result

You need to plug in the appropriate object name in the first line of the Apex code, execute the code and then see the debug to log to get the desired list. Convenient but I thought we could do better and that’s when I approached a dear friend Deepak Anand.  We discussed it and contemplated a way to provide a better user experience. We decided to spin up a user interface to give the user the ability to choose multiple objects and then click on a button to see the universally required fields along with other miscellaneous information for the selected object. Now there might be multiple apps out there which let you do this and much more but the idea was to learn, test it for ourselves and see how it pans out. And we had a tad bit of time to kill anyway. So this is what our time killing produced:

Required Fields Inspector


Like it? Then go install it!

Production or Dev Org:


Github link:

  • Excellent work guys 🙂

    This is great !!

  • Balaji Srinivasan


    I had to do a very similar thing this week – except that I didn’t take it to build a VF page since it needed to be done for all objects from a reporting stand-point. We ended up making a weekly scheduled job. But, this is a pretty good post from you & Deepak.


We're not around right now. But you can send us an email and we'll get back to you, asap.


© 2018 Succeed With Salesforce | Website by

Log in with your credentials


Forgot your details?