Original: SharePoint 2013 State machine Workflow Updateitemactivity
There is nothing to say, an introduction to activity, other similar activity can also refer to this use.
1, add applyactivation and updateitemactivity, below the onWorkflowActivated1 node, setStateActivity1 node above, such as:
2, configure Applyactivation _context, new field, remember is the field, not the property:
3, Configuration Applyactivation _workflowproperties, select the existing workflowproperties, such as;
This property is selected by the Workflow property that contains the workflow information in the code, which is the property of the following code declaration:
Public spworkflowactivationproperties workflowproperties = new Spworkflowactivationproperties ();
4, configuration updateitemactivity _context for step two to create the applyactivation _context;
Then create a new Listid field and a ListItem field, assign a value in the code, refer to step 5;
5, for example, right-click on the updateitemactivity, bind the Item property, and create a new property, and create a new Listid and ListItem fields (the first is a property, the rest is the field, do not mix);
6. Add code in the Onworkflowactivated1_invoked method
Private voidOnworkflowactivated1_invoked (Objectsender, ExternalDataEventArgs e) {MODIFYTITLEUPDATEITEMACTIVITY_LISTID1=workflowProperties.ListId.ToString (); Modifytitleupdateitemactivity_listitem1=NewSpitemkey (Workflowproperties.itemid); Modifytitleupdateitemactivity_itemproperties1=NewHashtable (); Modifytitleupdateitemactivity_itemproperties1.add ("title","in"+ DateTime.Now.ToString ("YYYY-MM-DD HH:mm:ss") +"Updated by Workflow");}
7, the implementation effect of the deployment is as follows:
Conclusion
Updateitemactivity is a SharePoint 2013 workflow in the activity of an update list item, the beginning of use is not very good, and later searched for some information, the time of the link does not remember the information, I am sorry can not be attached.
Code Download Sharepointworkflowupdateitemactivity.rar
Updateitemactivity of SharePoint 2013 state machine Workflows