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
RichardQRichardQ 

Mandatory fields are not tagged as a minOccurs="1" in the WSDL files.

Hi.

One of my SF users has set the mandatory state on a custom field.

But when I export the enterprise WSDL file, that column, though correctly typed, has a minOccurs="0".

<element name="Prospective_Target__c" nillable="true" minOccurs="0" type="xsd:double"/>

As a consequence, my mapper hasn't got the all the rules it needs to enforce this rule automatically.

Setting minOccurs="1" maxOccurs="1" is a very easily understood pattern, and especially on a simple element.

Is this something that could be done?

Conversly, because the WSDL files say the column is NOT mandatory in any descernible way, it shouldn't reject content in the way it now does. Hmm. Yeah, I know that's pushing things a bit, but I hope you can see the point.

I'm new on here, so is there anything else I need to ask to get some resolution on this?
SuperfellSuperfell
Hi,
Because the update method support partial updates (i.e. you only need to send the fields you want to change rather than all the fields), the elements in the WSDL can't be marked as minOccurs='1'. 

The describeSobject API call has information about the requiredness of fields.
RichardQRichardQ
Thank you for that. That makes sense. Need to design in the logic to handle sObject as well as the WSDL file. Another small pipeline task.