Accessing InfoPath form content in code

Source: Internet
Author: User

form is a very important feature of Moss, especially with the support of form services, we often use InfoPath when we do a form solution, so how do we use code to access the contents of an InfoPath form saved in a SharePoint form library? is necessary to know.

In summary, there are 3 ways to achieve code access to the form's content:

1. Promote form template properties

2. Action on a form file by XmlDocument object

3. Deserialization of form data schemas

Next, simply talk about the simple implementation steps of these 3 methods

The first way: to promote the form template property form action:

When you finish designing your form template, when you execute the Publish Wizard, you publish the form fields that you want to access through code, and the check allows users to edit

Access code:

The first is to get the current list item, SPListItem Item=infopath item, such as

SPListItem item= workflowproperties.

Item;item ["workflowstatus"] = value;

Item. Update ();

This approach is simple, but it's not safe to allow users to edit. For some sensitive data, this method is not recommended.

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.