+ Start a Discussion

Describe response NOT returning fields as required


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?

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.
Thanks. Also, is it possible for admin users to set fields as required, and not just layout required?

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.