Updateitemactivity of SharePoint 2013 State machine Workflows

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.