Tuesday, January 24, 2017

PnP Core Provisioning: Part 2

Microsoft Patterns and Practices group has developed a deployment tool for SharePoint called PnP Core that allows you to provision structure, data, settings, security, and artifacts to a SharePoint site from an XML input file.  I pulled the captured template and removed some of the nodes.  Below are two fields pulled from the XML that show a Single line of text and a Multiple lines of text field definition:

            <Field Type="Text" 
                   DisplayName="SingleLineOfText" 
                   Required="FALSE" 
                   EnforceUniqueValues="FALSE" 
                   Indexed="FALSE" 
                   MaxLength="255" 
                   ID="{ce3ab098-96f6-444f-83e0-9f3e875a48c5}" 
                   SourceID="{{listid:Part2List}}" 
                   StaticName="SingleLineOfText" 
                   Name="SingleLineOfText" 
                   ColName="nvarchar3" 
                   RowOrdinal="0" />
            <Field Type="Note" 
                   DisplayName="MultipleLinesOfText" 
                   Required="FALSE" 
                   EnforceUniqueValues="FALSE" 
                   Indexed="FALSE" 
                   NumLines="6" 
                   RichText="TRUE" 
                   RichTextMode="FullHtml" 
                   IsolateStyles="TRUE" 
                   Sortable="FALSE" 
                   ID="{564f1328-8812-4b3a-8413-af7983304fd0}" 
                   SourceID="{{listid:Part2List}}" 
                   StaticName="MultipleLinesOfText" 
                   Name="MultipleLinesOfText" 
                   ColName="ntext2" 
                   RowOrdinal="0" />

If you look at the definitions above you can see that the Type of the SingleLineOfText is Text and the type of the MultipleLinesOfText is a Note.  The other attributes are pretty simple to understand.  The DisplayName is what shows in views, and the Name is the internal name.  The ID is the internal GUID that uniquely identifies the column.  It is important that the GUIDs are unique.  If you copy a column and forget to update the GUID and have duplicates, you will get very strange behavior.  You could destabilize your entire farm. The SourceID points to the list that contains the field.

No comments:

Post a Comment