Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

SPWorkflowActivationProperties.Item is null on New Document

$
0
0

I have a workflow which runs on the creation of a new document in a library. The workflow checks the document out, modifies the name, then checks it back in.

If I create a document via New Document (MS Word opens, required document properties are set, document is saved to the library) the Item property of SPWorkflowActivationProperties is null. The ItemId property is set however.

If I add a document via Upload Document, Item is not null and I can do the modifications.

The library on which this workflow runs requires checkout before edit. If I disable this option, Item is not null when adding via New Document.

Would this have something to do with the New Document method checking out the document after saving to the library, whereas the Upload Document method does not?

I retrieve the item from the workflow properties as follows

public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();

private void onWorkFlowActivated_Invoked(object sender, ExternalDataEventArgs e)
{
    SPListItem document = workflowProperties.Item;

Any help would be greatly appreciated. Thanks.



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>