In-depth introduction to InfoPath-allows administrators to deploy InfoPath forms

Source: Internet
Author: User

Application scenarios:

When we (Party B) provide customers with a workflow solution based on InfoPath forms (especially those containing hosted code), we often need customers (Party) the SharePoint administrator of to help deploy on the Server where the SharePoint Server is installed. The Administrator does not need to know the steps required to deploy the InfoPath Service, we are reluctant to see that the scheduled tasks are completed through tedious operations. We all know that enterprise software has a feature: as few Code as possible. Use as few code as possible if there are few problems. Therefore, it is best to use commands to deploy InfoPath Service to automatically deploy InfoPath forms.

Basic Principles:

Use bat or PowerShell to execute SharePoint management commands. SharePoint provides administrators with the following command to deploy InfoPath forms:
% STSADM %-o RemoveFormTemplate-filename

% STSADM %-o uploadformtemplate-filename

% STSADM %-o deactivateformtemplate-url % SITEURL %-filename

% STSADM %-o activateformtemplate-url % SITEURL %-filename

Reference scheme:

We now need the customer's SharePoint Administrator to redeploy our business trip application process.

1. Place the following file structure:

2 bat script

 @SET STSADM="%programfiles%\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE"
@SET SITEURL="https://www.cnblogs.com/sites/mingle"

%STSADM% -o RemoveFormTemplate -filename "Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

%STSADM% -o uploadformtemplate -filename "Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

%STSADM% -o deactivateformtemplate -url %SITEURL% -filename "Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

%STSADM% -o activateformtemplate -url %SITEURL% -filename "Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

pause

If we deploy the InfoPath form for the first time, we can only use uploadformtemplate and activateformtemplate.

Note:

A. execadmsvcjobs this command can ensure that the assigned task is executed immediately. In actual deployment, we often encounter more than 10 hours after the deployment, and the new InfoPath design takes effect.

B. Why do we need to reactivate the InfoPath form before redeployment? Because the newly designed site of the InfoPath form is not reactivated, the new design information will not take effect.

The above problems often occur when we manually deploy InfoPath forms.

 

 

Additional reading:

You can deploy the sandbox InfoPath form using Feature in SharePoint2010. The following command is available:

Uninstall the existing solution (based on the from file name ):
Uninstall-SPInfoPathFormTemplate-Identity Exampleform. xsn
Install the new solution (based on the from file name ):
Install-SPInfoPathFormTemplate-Path C: \ Form. xsn
Disable feature on site collection level
Disable-SPInfoPathFormTemplate-Identity "Form. xsn"-SiteHttp: // SPSite 
Enable feature on site collection level
Enable-SPInfoPathFormTemplate-Identity "Form. xsn"-Site "http: // SPSite"

 

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.