Sladescross's Blog

Blogging about Sharepoint related stuff

Infopath Form Services are not available February 8, 2012

Filed under: Infopath,Infopath 2010,Infopath Form Services Are Not Available — sladescross @ 11:04 am

“Cannot generate the Microsoft InfoPath form because Form Services are not available”

  • Verified “Allow users to browser-enable form templates” and “Render form templates that are browser-enabled by users” were checked inCentral Admin > General Application Settings > (InfoPath Forms Services)Configure InfoPath Forms Services. (In my case, they already were.)
  • Activated “SharePoint Server Enterprise Site features” from Site Settings > (Site Actions) Manage site features. (This appeared to make difference and may or may not be necessary, but I did it and didn’t undo it before the next step so I’m including it here.)
  • Activated “SharePoint Server Enterprise Site Collection features” from top level site settings (site collection’s Site Settings) > (Site Collection Administration)Site collection features.
  • Performed an IIS reset.
  • Exited Microsoft SharePoint Designer, which was open, and restarted it. (Found this application restart to be necessary.)
  • Proceeded to use Designer’s Create Lists & Form. No error message this time.
 

Infopath Form Migration July 21, 2011

Filed under: Infopath,Infopath Migration — sladescross @ 1:27 pm

http://www.sharepointjoel.com/Lists/Posts/Post.aspx?List=0cd1a63d%2D183c%2D4fc2%2D8320%2Dba5369008acb&ID=465

Migrate the Infopath admin form.

STSADM –o exportipfsadminobjects

Update-SPInfoPathUserFileUrl

 

 

 

Infopath Forms Services Emulate User Roles November 29, 2010

Filed under: Infopath,Infopath User Roles — sladescross @ 8:17 pm

http://sharepointsolutions.blogspot.com/2009/04/how-to-emulate-user-roles-in-infopath.html

Many of my SharePoint consulting clients and students express the need to have different users see different views of an InfoPath form. In the InfoPath client, this is easy to handle using the User Roles
functionality which has been well-documented elsewhere. Unfortunately, User Roles are not supported by InfoPath Forms Services for your browser-enabled forms. Here is a work-around that I have been using for quite some time that has worked well for me and my clients and students.

In this post we’ll create a simple InfoPath form with two views: one view for most users and another view for administrators only. When the form loads, it will check to see if the current logged in user is an Administrator for that form and if he is it will display the Admin View to the user. If the user is not an administrator for the form, it will display the User View.

Create a Custom List to Store Users and Permission Levels

Although SharePoint exposes a number of web services that reveal security information and information about SharePoint Groups, I’ve never been able to get them to work reliably with InfoPath, especially without writing code. Since I can’t use SharePoint Groups, I create a custom list to store the names of my users who will be administrators.

 

Infopath 2010 Debugging November 23, 2010

Filed under: Debugging,Infopath,Infopath 2010 — sladescross @ 3:44 pm

http://msdn.microsoft.com/en-us/library/gg271285.aspx

 

Infopath Promotion and Demotion Of Properties June 30, 2010

Filed under: Infopath,Infopath Property Promotion and Demotion,Promoted — sladescross @ 2:52 pm

http://blogs.msdn.com/b/andrew_may/archive/2006/07/10/sharepointbeta2infopathformsincontenttypes.aspx

 

Infopath Save Redirection For User Drafts April 27, 2010

Filed under: Infopath,Redirect,Save,Save Redirection — sladescross @ 10:54 am

http://www.infopathdev.com/forums/p/14597/51881.aspx

Setting the “submit” location for InfoPath forms is easy enough. But unless we disable the “save” button, users can save the form as well. And being able to save a form before it is submitted is a good idea.

Unfortunately, the default save location is where the form is opened from. But we can alter this location in the javascript that launches the form.

You need to create some custom links that launch forms. These links call the createNewDocumentWithRedirect function. This function is called by SharePoint itself when you click the “New” button. I’ve abstracted the function so that it can be used on any site and only need to pass in the relative site path and InfoPath template we’re calling. This code can go into a content editor webpart.

Of particular interest below is the strSaveLocation variable. Setting this to ‘C:\\Documents and Settings\\All Users \\Desktop’ will save the form on the users desktop rather than the form library, but will still allow it to be submitted to the form library.

The site parameter is the relative url of the site, e.g. sites/mmr. The template parameter is the name that the form is published under. In the below case it is the Breaches and Incidents Notices form.

<script>
      function newForm(site, template){
            var url = 'http://' + window.location.hostname + '/' + site + '/';
            var template = url + template + '/Forms/template.xsn';
            var saveLocation = 'C:\\Documents and Settings\\All Users\\Desktop';
            var progID = 'SharePoint.OpenXmlDocuments.2';
            var bXMLForm = true;
            var redirectUrl = url + '_layouts/FormServer.aspx?XsnLocation=' + window.location;
            var defaultItemOpen = 0;

            createNewDocumentWithRedirect(template, saveLocation, progID, bXMLForm, redirectUrl, defaultItemOpen);
      }
  </script>
<P><A href="#">Please click here to create and submit
 a new Breach and Incident Notice.</A>
 

Infopath Form Conflict Dialog April 8, 2010

Filed under: Form Conflict,Infopath — sladescross @ 11:25 am

http://blogs.msdn.com/infopath/archive/2004/05/20/136165.aspx

There are two options at this point.  I can either open the newer template (Version 1.0.0.2) by clicking ‘Replace Form on Your Computer’ or the older one (Version 1.0.0.1) by clicking ‘Keep Form on Your Computer’.  It is important to note that this dialog does not affect the original copies of these files in any way.  It will only update your local cache and it will update the file that is shown with this Form Name in your Fill Out a Form dialog.

 

Get Infopath Form Version April 7, 2010

Filed under: Form Version,Infopath,Infopath Form Version,Versioning — sladescross @ 5:30 pm

http://weblogs.asp.net/wkriebel/archive/2009/04/29/how-to-display-the-infopath-form-version-on-the-form.aspx

Tip: insert form version with the expression:
substring-before( substring-after( /processing-instruction()[local-name(.) = "mso-infoPathSolution"], ‘solutionVersion=”‘), ‘”‘)

 

Infopath Versioning

Filed under: Infopath,Versioning — sladescross @ 4:54 pm

http://vspug.com/ssa/2009/02/21/infopath-tip-managing-older-versions/

The drop down has three options:

> Do nothing (existing forms might not work properly)
> Automatically upgrade existing forms
> Use custom event

By default, the first option “Do nothing …” is selected. Select the second option “Automatically upgrade existing forms” and save changes. Publish your form. This will automatically upgrade the existing forms and you won’t have to update their XML manually which can be quite cumbersome if the library contains hundreds or thousands of forms which is a common scenario in big companies. Some times, it is necessary to keep the existing forms as they are and upgrade them manually if need be but that is rare.

User can also take advantage of “Use custom event” option. This will add an event handler to the form where you can add your own custom code but this will be useful only if you know what changes you had made in the form. You can read more about it at http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.formevents.versionupgrade.aspx.

For example, you can check the version number of the form being opened and the version number of the template and if the form’s version is older than the template’s version then you can use custom code to handle the situation. For example, the following will give you the version numbers:

http://blog-sharepoint.blogspot.com/2009/09/infopath-form-content-type-template.html

Changing the file name to keep previous version of the form template.

http://www.delphi-ts.com/blogs/lozzi/post/2009/07/08/Versioning-Your-Published-InfoPath-Forms.aspx

Clear explanation of what to do when needing to preserve previous version[s] of an Infopath form template.

 

Deploy Infopath Form Services Solution Using Feature and WSP April 1, 2010

Filed under: Deployment,Feature,Infopath,Infopath Deployment,WSP,XSN — sladescross @ 4:32 pm

http://blah.winsmarts.com/2008-8-Deploying%5FInfoPath%5F2007%5FForms%5Fto%5FForms%5FServer%5F-and-ndash%5FProperly.aspx

 1:  <?xml version=”1.0″ encoding=”utf-8″ ?>

   2:  <Feature xmlns="http://schemas.microsoft.com/sharepoint/"
   3:           Id="41CEE181-9440-4536-A1DA-73F41D2155B7"
   4:           Title="My Form"
   5:           Description="This feature deploys the browser enabled InfoPath Form."
   6:           Version="12.0.0.0"
   7:           Scope="Site"
   8:           DefaultResourceFile="ipfscore"
   9:           ReceiverClass="Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver"
  10:           ReceiverAssembly="Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" >
  11:      <ActivationDependencies>
  12:          <ActivationDependency FeatureId="C88C4FF1-DBF5-4649-AD9F-C6C426EBCBF5"/>
  13:      </ActivationDependencies>
  14:      <ElementManifests>
  15:          <ElementManifest Location="element.xml"/>
  16:          <ElementFile Location="MyForm.xsn"/>
  17:      </ElementManifests>
  18:      <Properties>
  19:          <Property Key="FeatureName" Value="My InfoPath Form Template Feature"/>
  20:      </Properties>
  21:  </Feature>
   1:  <?xml version="1.0" encoding="utf-8" ?>
   2:  <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   3:      <Module Name="XSN" Url="FormServerTemplates" RootWebOnly="TRUE">
   4:          <File Url="MyForm.xsn" Name="MyForm.xsn" Type="GhostableInLibrary"/>
   5:      </Module>
   6:  </Elements>
Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver
http://blogs.infosupport.com/blogs/porint/archive/2007/04/24/How-to-deploy-an-admin-approved-form-template-using-the-feature-framework.aspx

Background to the Infopath form solution. By downloading the solution from the farm config store.

http://creativesharepoint.posterous.com/solution-packaging-infopath-forms-for-sharepo

Focus on how to deploy with UDCX connections and code-behind DLL.InfoPath Data Connections
If your form needs to use any external data connection files (.udcx files), go through these steps to make sure the deployed InfoPath form will look for the external data connection file in the Central Administration site that it is uploaded to.  The point of this is so that you don’t have to reconfigure paths in the InfoPath form and re-publish every time you want to deploy to a different SharePoint farm. You will still need to create a new .udcx file and upload it to the Central Administration on the new farm, but that's a lot easier than the alternative!

  1. Convert Any Non-External Data Connections to External Data Connections (.udcx files) and upload them to a data connections library
    • In InfoPath Designer, click “Tools” > “Data Connections”
    • Select the data connection and click “Convert…”
    • Enter the URL of any SharePoint Data Connections library that you have contribute access to (don’t worry, this won’t be the final resting place of the .udcx file)
    • Select “Centrally managed connection library (advanced)” and click “OK” 
  2. For any existing External Data Connections, check to make sure they are set to be centrally managed
    • In InfoPath Designer, click “Tools” > “Data Connections”
    • Select the data connection and click “Modify…”
    • Click “Connection Options…”
    • Select “Centrally managed connection library” and click “OK” 
    • Click “Next >” through the rest of the options and finally “Finish”
  3. Download, update, and upload the External Data Connection files to Central Administration
    • Browse to the Data Connections library that you uploaded the External Data Connection files to from step 1.
    • Click the drop down next to the name and select “Send To” > “Download a Copy”
    • Open the .udcx file in your favorite text editor (let’s hear it for Emacs!) and make modifications.
      • Set the “UseFormsServiceProxy” attribute to “true” wherever it is set to “false”
      • Change any web service URLs to the appropriate URLs (think development, staging, or production environments)
    • Browse to the Central Administration of the SharePoint farm you are going to deploy this InfoPath form to.
    • Click “Application Management” then under the “InfoPath Forms Services” section click “Manage data connection files”
    • Click upload

InfoPath Deployment

  1. If the form is not already there, copy the InfoPath form into the root of the solution. Your solution should now look like figure 2 at the bottom of this post.
  2. Open the InfoPath form in InfoPath Designer
  3. Publish the Form
    • Select “File” > “Publish”
    • Select “To a network location” for where you want to publish the form template and click “Next”
    • For the path, navigate to the TEMPLATE\FEATURES\InfoPathFormFeatures folder in your solution.
    • Enter the “Form template name” and click “Next”
    • On this screen, clear out any text in the text box and click “Next”.  It is possible that a prompt might appear stating: “Users will not be able to open this form because of the security level it requires and because no alternative access path has been specified.  To enable users to open the form, you must enter an alternative access path.  Click OK, to continue publishing the form template or Cancel to enter an alternative access path."  This form can be safely ignored, since when this form is published to Central Admin, the correct permission level will be automatically assigned.
    • Click “Publish”
    • Click “Close”
  4. Add the published form to the feature folder in your Visual Studio Project
    • Right Click on the feature folder and click “Add” > “Existing Item…”
    • Select the published InfoPath form and click “Add”

InfoPath Code Behind
If your InfoPath form has .Net code behind, run through these steps. On a side note, as far as I know, InfoPath 2007 form code behind is automatically created in Visual Studio 2005.  So if you were previously using Visual Studio 2008 like I am, you might just skip step 1 and manually add the project to your source control. (You are using source control right?)

  1. Add the Visual Studio project for the form code behind to this solution for easy reference
    • Click “File” > “Add” > “Existing Project…”
    • Select the .csproj file for the InfoPath form code behind and click “Open”
  2. Add the code behind .dll to the Feature folder
    According to this post, an error is thrown if you don’t deploy the code behind .dll in the feature folder (yes, even if it is already deployed in the GAC.  I haven’t seen this first hand, but hey, I’m a trusting guy!)
  3.  

  • I created a file called WSP.ddf in the root of the project. This will be used to create a solution package to deploy and InfoPath Feature.
  • I then finally added a manifest.xml file to the project.
  • In the properties of the project, in the Post Build Events, I added the following which will create my deployment package when the project is built:
    cd $(ProjectDir)
    MakeCAB /D outputDir=$(OutDir) /f "WSP.ddf" 
  •  

     
    Follow

    Get every new post delivered to your Inbox.

    Join 27 other followers