In this article we will discuss how to find required fields of an Salesforce Object . The code given here to find required fields is applicable for Standard and Custom Objects as well .
There is no standard build in method available in Salesforce to find List of all required fields .
To demonstrate the concept we have created the Custom Object named as Student , Which is having one required field – *Age .
Find all Standard and Custom required Fields
Now In order to find the field is required or not we can use the isNillable() method . The following code will return all the Standard and Custom required fields.