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
shunshun 

Describe response NOT returning fields as required

Hi,

In my Salesforce account, I setup some fields as "Required" in my "Lead Layout" but when I make a "describe" call, the response does not indicate that the fields are required (ie: the nullable element is NOT "false" for these fields)

On the Salesforce web site, the fields are in fact "Required" when I try to create a lead.

What am I missing?

Thanks
Shun,
fouloxfoulox
I'll help out with this one. There are required fields, and then there are layout required fields, (or fields that user defined as required). If a field is user defined as required you are not required to enter data in that field by the API, only by the web interface, but you can find out what fields are layout required by adding the layout parameter to your describe call. Take a look at page 11 in the API documentation under the title Page Layout Information.
shunshun
Thanks. Also, is it possible for admin users to set fields as required, and not just layout required?

Shun
fouloxfoulox
Not to my knowledge. But you should be able to handle your problem progammatically since you know which ones have been deemed as layout required through the describe call.