Quantcast
Channel: Nintex Connect: Unanswered Threads
Viewing all articles
Browse latest Browse all 2462

Corrupt Documents when using multiple Content Types and Create Item action

$
0
0
Scenario
Users submit a request to create a new document within a Custom List. After the request is approved, a new document is to be created in a Document Library named Pending Documents. This Document Library holds multiple Site Content Types; these Content Types all inherit from the same Base Content Type (which is based on the Document Content Type) and have the same metadata. Each of these Content Types has a different Template assigned; either Word (.docx) or Excel (.xlsx). These Document Templates are stored in a separate Document Library.

Problem
Creating a document in my Document Library via the Create Item workflow action works 'fine', but I have issues opening the created document if the Content Type has a template assigned that is of the type Excel. The file is created, but the extension of the created file is .docx. As a result, opening the document results in an error (The file is corrupt and cannot be opened). Creating documents which have a Word based template works like a charm.

Findings
The problem seems to be related to the way templates are assigned to Content Types. My Site Content Type has the proper Excel template assigned, as creating a document via the SharePoint UI uses the correct template. When creating a document via the Create Item action within workflow, it seems the document is created in the format being used by the template file that can be found in the root of the Forms Folder of the concerned Document Library (accessible via Windows Explorer). This template, in my scenario, is a Word document named 'template.dotx'. I'm quite sure the format used is .dotx due to the fact I created the Document Library and did not change the Document Template settings (hence, it uses the default setting Microsoft Word document). When I create a new Document Library, and upon creation set the Document Template to 'Microsoft Excel spreadsheet', the same problem as described above occurs (but then Content Types with a Word template return an error, Excel based templates work fine). 

Workaround
A potential workaround would be to have seperate Document Libraries for both template formats. This could be a possible work-around, as I can use the Copy Document action to move the document to my Pending Documents Library. This is not a preferred solution as the format of the Document ID will differ due to the fact the document is created in a different Document Library.

Questions
- What is the mechanism used by the Create Item action to determine the template that is used to create a document? 
- Am I missing something obvious here? 
- Is there an alternative to achieve the scenario described above?

Viewing all articles
Browse latest Browse all 2462

Latest Images

Trending Articles



Latest Images