The ID Element property is the blueprint for your custom Workplace ID. It is a string that utilizes XML markup to build the ID.
To begin constructing the property, the XML string will need a parent node of IDFormat. The IDFormat parent node will contain one or more child nodes IDElement that will make up the individual pieces of the ID. There are four different types of IDElements that can be used to construct your custom ID. To specify the element type, the IDElement node requires a type attribute with one of the four elements provided.
IDElement Syntax When an IDElement contains text in the middle, such as with the text or date elements, there is an opening and closing part of each node set as <IDElement>xxx</IDElement>. However, when there is no additional middle content such as with ID, AlphaCounter, DayOfYear, ListID, SiteID, the syntax is just one part such as <IDElement type=xxx />. The /> closes the node.
Attribute Names ARE Case Sensitive The attribute names, such as padding, padChar, and pad are case sensitive.
Padding - When using padding, it takes into account the total number of characters in the element. For instance, if you say padding=5 this means that you are saying that the string should have 5 characters. If it has 4 characters, then it will pad with 1 character. If it has 5 or more characters, it will not pad.
Represents the auto increment portion of the ID to increment alphabetically from A to Z, then on to AA, AB, to AZ, and then to ZZ. From there, additional digits are added, starting with A. The DailyReset attribute can be used to reset the counter to A for each day.
DailyReset (attribute, optional) Resets the counter back to A each day. If this attribute is not used, it will continue to build out the alpha counter.
Example: <IDElement type="AlphaCounter" resetDailyCounter="true" />
Sample Output: AAA,AAB,AAC
A date element can be used to specify a date or any portion of a date when the record is created to be used as part of the ID.
Example: <IDElement type="date">MMMddyyyy</IDElement>
Please see the following page for more information on datetime format specifiers: http://msdn2.microsoft.com/en-us/library/8kb3ddd4.aspx . Note that the datetime format specifiers provide functional differences and are not merely masks for content. For instance, in reference to the use of month syntax, there are four format specifiers as follows. The result differs.
|
M |
The month, from 1 through 12 |
6/15/2009 1:45:30 PM -> 6 |
|
MM |
The month, from 01 through 12 |
6/15/2009 1:45:30 PM -> 06 |
|
MMM |
The abbreviated name of the month |
6/15/2009 1:45:30 PM -> Jun (en-US) 6/15/2009 1:45:30 PM -> Juin (fr-FR) 6/15/2009 1:45:30 PM -> Jun (zu-ZA) |
|
MMMM |
The full name of the month |
6/15/2009 1:45:30 PM -> June (en-US) 6/15/2009 1:45:30 PM -> Juni (da-DK) 6/15/2009 1:45:30 PM -> uJuni (zu-ZA) |
Used to enter a counter for the day of the year. The day number is a three-digit number from 1 to 366 (to include leap year). It runs from January 1 to December 31. The number is automatically padded to three digits so, for example, January 12 is 012.
Sample Output: 285
A field represents the value of another field within the list item. This value can be the field value in its entirety, or it can be a portion of the field value from either the beginning or end of the field value. For instance, say there is a field called Project that contains the names of projects. All of the project name or a portion can be picked up by the Workplace ID.
To specify the internal name of the field, provide an attribute internal and set its value = true. Otherwise, the display name will be used by default.
To use only a portion of the field, you can provide the start attribute and set it value = true along with the chars attribute, setting it equal to the number of characters to display (e.g., start= true chars =3 will return the first 3 characters in the field).
Setting the start attribute = false will do the opposite and pull the content from the end of the value.
To return the content back as uppercase, provide the upper attribute and set it equal to true.
To return the content back as lowercase, provide the lower attribute and set it equal to true.
Example: <IDElement type="field" internal="true" chars="3" start="true">FieldName</IDElement>
The following is an example of a Workplace ID that consists of the first three characters of a field called Manufacturer, followed by the month and day, and then the ID number.
Combined Example: ACM0509250XX (for a record with a Manufacturer named ACME, Inc. that was created on May 15, 2009, as record 250)
<IDElement type="field" chars="3" start="true">Manufacturer</IDElement>
<IDElement type="date">MMdd</IDElement>
<IDElement type="id" padding=5 padChar=X pad=right>
NOTE: When working with field values, the Workplace ID will treat a blank space as a character it does not strip the blank out of the string.
The number of characters to pad the element with. Padding characters will be added to reach that number. When working with field values, you may want to pad them to provide a consistent length, so that if a value is short it will have the same character length which is easier to read.
The character to pad the element with.
Controls which side of the element to pad, right or left. If omitted, the default is left.
start (attribute, optional)
Controls whether the text is captured from the beginning or end of the field.
upper (attribute, optional)
Controls whether the text will be saved in upper case.
Example:
<IDFormat><IDElement type="id" padding="5" pad="left" padChar="0" /></IDFormat>
This element type represents the auto increment portion of the ID. It increments by 1.
Example: <IDElement type="id"/>
This is the most basic syntax. Padding is usually used to specify a consistent number of digits. This makes the ID easier to read and will put items in a proper sort order when viewed in a display.
The minimum number of characters for the element. Padding characters will be added to reach that number.
The character to pad the element with. There is no default padChar. This is required for the padding to take effect.
Controls which side of the element to pad, right or left. If omitted, the default is left.
Example:
<IDFormat><IDElement type="id" padding="5" pad="left" padChar="0" /></IDFormat>
Returns the GUID for the list. The GUID is unique across a SharePoint farm, so using this element along with just the type=id will provide a unique ID across the farm.
Example: <IDElement type="ListID" />
The following is an example of an ID that consists of the first three characters of a field called Manufacturer, followed by the month and day and then the ID number.
<IDFormat>
<IDElement type="field" chars="3" start="true">Manufacturer</IDElement>
<IDElement type="date">MMdd</IDElement>
<IDElement type="id"></IDElement>
</IDFormat>
(Introduced in v11.1) The relative path from the root of the server to the location of the list. This can be used to generate a URL to be used for actions, and allows you to retrieve all of the information you need with a single request to the server, rather than requesting the web service or Site List Data Provider to go back to each item to retrieve the site information. This helps improve performance and decrease the number of callbacks on the server.
The ID of the current site that the list belongs to. This is unique for the site across the server farm, so combining this element with unique static text for each list or library in a site, and a type=id will also provide a unique ID across the server farm.
Example: <IDElement type="ListID" />
(Introduced in v11.1) The fully qualified URL to the site where the list is located. This can be used to generate a URL to be used for actions, and allows you to retrieve all of the information you need with a single request to the server, rather than requesting the web service or Site List Data Provider to go back to each item to retrieve the site information. This helps improve performance and decrease the number of callbacks on the server.
Use this element to enter static text that can be specified within the ID. The text respects blank spaces.
Example: <IDElement type="text">Your Static Text</IDElement>
The minimum number of characters for the element. Padding characters will be added to reach this number.
The character to pad the element with.
Controls which side of the element to pad, right or left. If omitted, the default is left.
Example:
<IDFormat><IDElement type="id" padding="5" pad="left" padChar="0" />></IDFormat>
Enable this option so the workplace id field will generate an ID the first time an item is created in a document library. The default behavior is to hold off on creating the ID until the item has reached the end of its creation cycle, how ever for some types of libraries such as info path libraries the behavior is different and the ID will never be created so you need to enable the override document library check to prevent this from happening.
Indicates whether the field should be displayed when displaying an item.
Indicates whether the field should be displayed when editing an item.
Select this option to have all existing list items updated once the Workplace ID is added to the list. If this option is not enabled, the list items workplace ID will not be updated until the item is edited. When the Workplace ID is added to a list, it uses the internal SharePoint ID to create the sequence of IDs.
Default: True
TIP: You can change the Workplace ID syntax at any time. To do this, delete the Workplace ID field and then add it back into the list or library with the new syntax. The IDs are regenerated when you click OK. When Lookups are created, they do not look up to the Workplace ID field itself; this is prevented. Instead, create a calculated field that uses the value in the Workplace ID. Thus, if you change the Workplace ID syntax or the syntax of the calculated field, the Lookups within a site will remain intact and the change will cascade down to the related fields in child lists.
This is an integer that is used to tell the Workplace ID which numeric digit to start incrementing at. This can be set to start at 0, meaning the first ID will be 1.
Default: 0