A Practical Guide to SharePoint 2013

A Practical Guide to SharePoint 2013
A Practical Guide to SharePoint 2013 - Book by Saifullah Shafiq
Showing posts with label infopath. Show all posts
Showing posts with label infopath. Show all posts

Tuesday, April 12, 2011

The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service.

You get following error when you try to access an InfoPath form in 2010:







Resolution:

1. Run Central Administration
2. Click on Configuration Wizard right hand side navigation links and then Launch the Farm Configuration Wizard.
3. Start the Wizard
4. Make sure checkbox along with State Service is checked.
5. Click Next.

This will resolve the issue and the form will start opening.

Monday, March 15, 2010

InfoPath 2010 cannot connect to SharePoint 2010

You have installed Office 2010 beta and you are trying to connect to SharePoint 2010 from InfoPath but you get an error. [caption id="attachment_452" align="alignnone" width="603" caption="The internet address is not valid"][/caption] Figure 1: The Internet address is not valid. You click OK and you get another error “The operation could not be completed”. Click Show Details >> and you will see error “Unable to connect to the SharePoint site”. [caption id="attachment_453" align="alignnone" width="654" caption="The operation could not be completed."][/caption] Figure 2: The operation could not be completed. You try a little harder to connect to the SharePoint but this time you get yet another error “Network is down or you may not be connected to the network”. What do you do next? You check if the enterprise features are enabled or not. They are enabled. You check DNS settings. Settings are fine. Now what? It happens if you have not created a top level site collection. Create a top level site collection and then try to connect and it should work. If you are not sure whether you have created a top level site collection or not, try to open the main site URL in the browser. If the site does not open then you have not created a top level site collection. For example, http://sp2010/sites/spsite opens fine and you can access all areas of the site but http://sp2010 does not open, then you have not created a top level site collection and in this case if you try to connect to http://sp2010/sites/spsite from InfoPath you will get an error. To create a top level site collection, go to central admin site and follow these steps:
  1. Under Site Collections, click Create site collections link.
  2. Select web application where you want to create site collection from the drop down.
  3. Give title and description and select “/” from the URL drop down. Front slash stands for a top level site. You will not see it listed in the drop down if you have already created a top level site collection because you can only create one top level site collection per web application. You can create multiple sub site collections by selecting “/sites/” from the drop down and then entering the name of your site in the text box provided.
Root level site collection
Figure 3: Select top level for your site collection
4. Select a template for your site and enter primary site collection administrator and click OK. You are done. Now go and try to access the top level site link in InfoPath. It will work.

Wednesday, October 7, 2009

InfoPath fails after applying SP

Service packs fix lots of issues in the installations but sometimes they also create problems. It becomes a pain to track down the source of the problem if you have a huge setup. A user yesterday reported the following problem after he applied SP2 on the server running InfoPath: The format of the Canary has been tampered with for form xxxxxx by the end user. Exception message: The security validation for this form is invalid. Some users also reported this problem when they installed SP1. Exact cause is not known but following are some hints that can resolve the issue (at least temporarily unless you get a reliable fix): 1. Replace Microsoft.Office.InfoPath.Server.dll with the version that was working before you installed the SP. 2. Replace core.js with a newer version (worked for the user who reported this). Core.js is located in SystemDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\INC\

Friday, September 11, 2009

Setting expiration date in a content type policy

Copying InfoPath attachments from one section to another

http://walisystems.com/articles/SPS/infoattach/CopyingFileAttachments.htm Get code to copy attachments programmatically from one section in the form to another. Article gives a practical scenario and a solution to resolve the problem. Properties of file attachment control can be set at design time only. How can you restrict users from deleting the file after he has uploaded it and the form has been submitted? Read the article to learn how!

InfoPath 2007: Working with radio buttons and checkboxes

http://walisystems.com/articles/SPS/radiobtns/Infopathradiobuttons.htm See how you can hide sections and control checkboxes by selecting radio options. Learn what not to miss when setting conditional formatting and defining rules.

Capacity planning for InfoPath Forms Services

http://technet.microsoft.com/en-us/library/cc879113.aspx I believe this document should have been released early. Performance and quality for InfoPath forms are two issues that are as important as they are for SharePoint. If you have ever developed browser-enabled forms, you'll agree that creating large forms has some performance issues. Considering performace when designing forms is important. Capacity planning is equally important. Lot of effort goes into developing a large InfoPath form and without planning, your effort will either go waste or will not be appreciated by users.

InfoPath 2010 feature videos

Thursday, September 10, 2009

Building forms with InfoPath 2010

http://www.youtube.com/watch?v=VKJ3A12RfE8

InfoPath 2010 Overview Video

http://blogs.msdn.com/infopath/archive/2009/08/25/infopath-2010-overview-video.aspx

Select file was not found" error

I blogged about it long time ago but lost that post in a server crash. This error occurs when you try to attach a file in InfoPath task form. There are several solutions. One is as following: Open WrkTaskIP.aspx from the following location: C:\Program File\Common Files\Microsoft Shared\web server extensions\12\Template\Layouts Locate following tag: <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> Insert following line before the end tag "</asp:Content>": <script type="text/javascript">aspnetForm.encoding = "multipart/form-data";</script>

What's new in InfoPath 2010

Thursday, July 23, 2009

Generating proxy with svcutil.exe

svcutil /t:code http://webserviceURL /out:proxy.cs /config:configuration.config
Copy contents from configuration.config to the config file of your application.
svcutil.exe is located in C:Program FilesMicrosoft SDKsWindowsv6.0ABin folder . This is the default path if you did not change the installation path during installation.

Thursday, June 25, 2009

Create a visual studio template for InfoPath

If your jobs is to design InfoPath forms on a regular basis, it will be a good idea for you to create a visual studio template. Add basic code like validation functions, etc and basic layout with common fields and save it as a template. You can use this template to create new InfoPath projects. New projects will have all the basic fields, layout and common functions and it will save you lot of time. To create the template, create a new visual studio project for InfoPath. Design layout and add code. That's the easy part that you might have already known. Now, to create the template, go to "File" menu and select "Export Template".  If you don't see that option, you may have to reset the visual studio settings.
To do that, click cancel to close the "Export Wizard" and go to "Tools" menu and select "Import and Export Settings...".
You will be shown "Import and Export Settings Wizard". Select "Reset all settings" and click "Next".
Select option "No, just reset settings, overwriting my current settings" and click "Next".
From the list shown, select your appropriate environment. For example, if you are creating a template that has C# code and will be used for C# projects, select "Visual C# Development Settings". Likewise, for VB, you can select the VB development settings. Click "Finish"
Now go to "File" menu again and select "Export Template" option. If it still doesn't work, close and re-open visual studio.
Select "Project Template" and click "Next". If your solution has more than 1 project. The drop down at the bottom will show all the projects that are part of the solution and you will have to select one.
On the next screen, you can select icon, template name, template description, etc. Choose the output location and click "Finish".
The wizard will create a zip file that will contain all the necessary files required to create a new project.
Copy this zip file to the following folder on your development machine:
C:Documents and Settings[Current User]My DocumentsVisual Studio 2005TemplatesProjectTemplatesVisual C#
If it's a VB template, copy it to the "Visual Basic" folder.
Now, open visual studio, and in new project wizard, select project type "Visual C#" (OR Visual Basic if you created a VB template). The new template will appear under "My Templates". Select the template, change it's name and location and click "OK" to create the project.





Error: InfoPath cannot save the following form: Template1

I got this error when I was converting an InfoPath form (XSN) to a Visual Studio project. To create a visual studio project out of an XSN template, create an InfoPath project in Visual Studio. Rename the .XSN to .CAB and unzip the .cab file using any zip/unzip utility. Copy all the unzipped files to "InfoPath Form Template" folder in your new Visual Studio project. That's it. You get the error when you make changes to manifest.xsf and try to save them. To get rid of the error, make sure the files you copied to the project are not read-only. Remove the read-ony atribute if they are read-only. Second, open the manifest.xsf in notepad and remove the old paths from the file. Locate attribute "publishurl" in the file and clear it's value. It points to an old publish location which might not be available in your current environment.  Then, locate "runtimeCompatibilityURL" attribute and change it's value to your current server URL The URL should point to the formservices.asmx. The URL will be something like http://sharepointserver/_vti_bin/FormsServices.asmx. Save the file. Close and re-open your visual studio project. Now you can save the changes.

Saturday, February 21, 2009

InfoPath Tip: Managing older versions


InfoPath Tip: Managing older versions
Here is a small tip to manage older versions of InfoPath forms. This is a very simple tip and the solution is available out-of-the-box but unfortunately, InfoPath developers usually ignore this built-in feature and face problems after deploying the updated forms. You may have noticed that you get "Schema validation errors found" when opening an updated form. In fact, the form fails to open and it is difficult to locate the data sources that cause the problem. This question is asked frequently in the forums where users ask for solutions to fix the problem. Some users manually upgrade the XML of existing forms to make them compatible with the new template.

In the "Form Options", inside "Versioning" category, there is an option to manage version upgrades.



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:

public void FormEvents_VersionUpgrade(object sender, VersionUpgradeEventArgs e)
{
string formVersion = e.DocumentVersion;
string templateVersion = e.FormTemplateVersion;

//comparison code here
//if versions are different then do something


}

Another option is to add checks in the form using code. Suppose you added a new data source in the form. This data source will not be available in the forms based on the older template. You can check for the existence of the data source/node programmatically and handle business logic accordingly. For example, here is some sample code:

XPathNavigator node = this.CreateNavigator().SelectSingleNode("/my:myFields/my:newNode", this.NamespaceManager);
if (node != null) //if this node exists
{
   //Logic 1
}
else
{
   //Logic 2
}

node = null;

You simplly check the existence of the data source by comparing it to "null". If it's not null (node exists), run new logic for the new form else skip the new logic to keep the old forms intact.


Monday, November 17, 2008

InfoPathMVP Award Program Blog

The following blog shares some of the inspiring activities of MVPs around the globe: