Expand Minimize

SPC016501: Declare required attributes in FieldRef

Required attributes ID, Name must be declared in FieldRef.

CheckId SPC016501
TypeName DeclareRequiredAttributesInFieldRef
Severity CriticalError
Type FieldRef

Add required attributes ID and Name to FieldRef. Note: Attribute 'DisplayName' is not defined as required in the schema for FieldRef, but defined as required in the MSDN documentation. Therefore SPCAF considers this attribute as not required.
It is important to note, that inclusion in a built-in field can result in the built-in fields internal name.
See sample below:

<FieldRefs>
   <FieldRef
      ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"
      Name="Title"
      DisplayName="Item"
      Required="TRUE"
      Sealed="TRUE"/>
      ...
</FieldRefs>

To suppress this violation in XML SharePoint code add the following comment right before the XML tag which causes the rule violation. Learn more about SuppressMessage here.

<!-- "SuppressMessage":{"rule":"SPC016501:DeclareRequiredAttributesInFieldRef","justification":"Provide reason for suppression here"} -->
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.