Question

I have a problem that i've struggled with for a long time. This problem manifests itself in the test environment, but not in my dev environment.

I have a document library template. In a event handler I attach several content types (which all inherit from a base content type which in turn inherits from Document). The base content type has a custom document template, and event handlers defined in xmldocuments on the contenttype definition.

The Doc-ID feature is switched on in the site.

When uploading a file to the document library, the document is assigned a document ID as expected. When saving a file from Word however, the doc-ID is blank. Apparently the value is set on the item, because when changing the content type of the item afterwards, the doc-ID appears with a number indicating that it was assigned when the file was first saved. When setting the contenttype back to the original value, the Doc-ID remains displayed in the view.

To clarify: This is not the ID field of the Item content type, but the Doc-ID that is created by the doc-ID feature in SharePoint 2010.

Any ideas to why this value is not set when promoting values from Word?

Was it helpful?

Solution

It seems that the solution lied in the base Document content type in the site collection. When the document-id feature is activated, event handlers are added to the content type definition as xmldocuments. When a regular document library is created, the content type in the library inherits from this content type, and thus gets a copy of the event receivers. My custom document library with custom content types did not inherit from the site collection document content type, but rather from the base document content type (0x0101), and did not get a copy of the event receivers. Copying the xmldocuments into my base content type seems to do the trick.

<XmlDocuments>
        <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
          <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
            <Receiver>
              <Name>Document ID Generator</Name>
              <Synchronization>Synchronous</Synchronization>
              <Type>10001</Type>
              <SequenceNumber>1000</SequenceNumber>
              <Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
              <Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
              <Data>
              </Data>
              <Filter>
              </Filter>
            </Receiver>
            <Receiver>
              <Name>Document ID Generator</Name>
              <Synchronization>Synchronous</Synchronization>
              <Type>10002</Type>
              <SequenceNumber>1001</SequenceNumber>
              <Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
              <Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
              <Data>
              </Data>
              <Filter>
              </Filter>
            </Receiver>
            <Receiver>
              <Name>Document ID Generator</Name>
              <Synchronization>Synchronous</Synchronization>
              <Type>10004</Type>
              <SequenceNumber>1002</SequenceNumber>
              <Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
              <Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
              <Data>
              </Data>
              <Filter>
              </Filter>
            </Receiver>
            <Receiver>
              <Name>Document ID Generator</Name>
              <Synchronization>Synchronous</Synchronization>
              <Type>10006</Type>
              <SequenceNumber>1003</SequenceNumber>
              <Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
              <Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
              <Data>
              </Data>
              <Filter>
              </Filter>
            </Receiver>
          </spe:Receivers>
        </XmlDocument>
      </XmlDocuments>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top