Archive

Posts Tagged ‘InfoPath 2010’

Exporting Admin Approved #InfoPath Forms. #SP2007 to #SP2010

Just a quick blog to remind myself for some research I am doing.

We need to export existing Administrator Approved InfoPath forms and I came across this article:

In short, use STSADM to export a CAB and reimport using PowerShell.

As it is an older article soooo… just in case I lose it.  The details are below:

Admin approved form from MOSS 2007 get deployed as features within the 12 features hive under folders named with GUIDs. These need special handling to be moved to SharePoint 2010. The following steps need to be performed.

a) Export the Admin approved IP templates using stsadm command.

using stsadm -o exportipfsadminobjects command export the IP forms to a CAB file.

b) Import this into the SharePoint 2010 environment using the Windows PowerShell 2.0 Import-SPInfoPathAdministrationFiles cmdlet.

c) Check if the files are imported correctly by browsing to the Central Admin –> Manage Infopath Form Templates.

 

Other useful resources I found in my research on this topic:

Details further usage and includes updating of data connection files associated with InfoPath forms.

The Update-SPInfoPathUserFileUrl Command will allow you to updates your data connections in InfoPath form templates (.xsn files) and universal data connections (.udcx files) where references in the current farm should be updated when content is migrated to a different farm URL.

Upgrade resource links SP2007 to SP2010 from Microsoft

PowerShell CMDLets for importing into SharePoint 2010

Import-SPInfoPathAdministrationFiles

Imports Microsoft InfoPath 2010 form templates and .udcx files that are located on the SharePoint Central Administration Web site.

Update-SPInfoPathAdminFileUrl

Updates InfoPath form templates (.xsn files) and universal data connections (.udcx files), including all .xsn files and .udcx files that were deployed by an administrator.

Update-SPInfoPathUrl

Runs a Microsoft InfoPath 2010 .xsn/.udc fix-up on Microsoft SharePoint Foundation 2010.

Update-SPInfoPathFormTemplate

Upgrades all Microsoft InfoPath form templates on the farm.

Till the next time…

Hiding/Showing InfoPath 2010 form element using jQuery

November 3, 2012 Leave a comment

Get the code / Look for the highlight area

InfoPath 2010 is a great tool. However, while building forms in InfoPath it’s only a matter of time when you have a user requirment that InfoPath alone simply will not do. In that case you might have a few options. You could add custom code using VSTA, which means you will need to publish them as an administrator approved form template.You could ditch InfoPath completely and build your forms in Visual Studio 2010 using asp.net. You could build them using the client object model. Lots to think about. In addtion, you could manipulate some form element using jQuery. The video demonstrates a simple way to hide/show a textbox element using jQuery.

Moving repeating table values to another list using a Visual Web Part in C#

October 12, 2012 Leave a comment

InfoPath 2010 repeating tables are useful and sometimes even essential to the project requirements. However, they carry with them some problems. For one thing when multiple values are entered into an InfoPath 2010 form all of the values become crammed into one SharePoint 2010 column. This will cause all kinds of problem down the road if you ever need to access that Info and/or filter it etc. So the following example shows how to move the repeating table values to a separate list where the values can be more efficiently managed.

  • I’ve created a Visual Studio 2010 visual web part that fires the code on page load
  • You must have a delimiter to separate the values. In this case I have used a ;
  • Do NOT add a ; to the last repeating table entry. If you do you will have and extra record in the new list.

How does it work? View the Video below:

Publishing an Administrator-approved form template

October 12, 2012 Leave a comment

If you add custom code to InfoPath 2010 form template you will need to publish the form as an “administrator-approved” form template. Publishing an administrator-approved template is not an intuitive process (in my humble opinion). So, I create a video that will give a step-by-step of how this is done.

UK Phone numbers in InfoPath 2010

August 28, 2012 Leave a comment

I was working with a client recently who wanted to be able to submit InfoPath forms with a UK style phone number field of 5 numeric+space+6numeric format, ‘01234 123456’.

I had to do a fair amount of looking around in InfoPath and the web , but finally came across a quite neat solution of pattern matching.

Firstly I had to make the text box accept the data type Text (string)

image

I then created a validation rule for the PhoneNumber control, for the condition I used “PhoneNumber” “does not match pattern”

image

and selected “Select a pattern…” in the final box, this brings up the Data Entry Pattern dialog box.

image

From this you can now choose “Custom pattern” I used  pattern \d\d\d\d\d \d\d\d\d\d\d to format my input.

image

With the addition of a screen tip  the validation rule is complete

image

Categories: SharePoint 2010 Tags:

InfoPath 2010 People picker control

February 16, 2012 7 comments

New with  InfoPath 2010 is a People Picker control, this acts like the People Picker in SharePoint and allows you to choose contacts from AD.

image

image

I was using this control recently and wanted to promote the chosen person value to a list when the form is submitted, to my surprise I found that the submitted value was just a text value, not a presence aware name, so had none of the rich integration that OCS or Lync offers.

image

To get around this drawback I had to write a small workflow that fired when the form was submitted.

image

The workflow read the list value into a variable and then wrote it back to another column in the same list, but was key was to make the return field data type an Email Address.

image

Now we have a presence aware Name value.

Security Validation Issue – Form Services issue with SP1+June 2011 CU (Release 2) #in #SP2010 #SharePoint #MSProject #ProjectServer

July 20, 2011 10 comments

We are testing Service Pack 1 heavily in my project that I have talked about on this blog many times.

One of the features of our implementation is a number of developed InfoPath forms.  We found one issue previously that required a hotfix and it looks like SP1 and June 2011 CU (Release 2) has introduced another.

My colleague Paul Busby has mentioned it here:

http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010customization/thread/6d5ffcb6-7563-4234-9282-e767b56b97b2

and another user has also confirmed the issue.

I shall be sending the details below to Microsoft through our partner support and hopefully we can get a resolution.

 

Scenario:

  • Form Services
  • Administrator Approved Form
  • Server Version: 14.0.6106.5002 (Office 2010 SP1 + June 2011 CU – Release 2)
  • Client Version: 14.0.6023.1000 (Office 2010 SP1)
  • NB: June 2011 Cumulative Update does not include updates for InfoPath 2010
  • Microsoft June 2011 Cumulative Update for Office 2010 Client Applications – KB2259686: http://support.microsoft.com/kb/2259686/en-us

The form has two views:

  • View one has a people picker
  • View two is blank

The form is uploaded via Central Administration and activated to a site collection

A form library is created and the associated content type is attached

Upon creating a new form, the form loads

Screenshot 1

When the user switches views in the form, a Security Validation Error occurs:

Screenshot 2

Further Details:

  • We have discovered that it appears to happen when switching to or from a view that contains a people picker field.
  • Turning off security validation, allows the form to continue to work, but this is not something we want to go live with
  • This issue has been found on a client DEV and TEST environment as well as a newly installed RTM machine upgraded to SP1 + June 2011 CU Release 2

SharePoint 2010 Log Details (specific details in red):

07/20/2011 13:54:03.85           w3wp.exe (0x10CC)                           0x11BC           SharePoint Foundation                     Monitoring                               nasq     Medium            Entering monitored scope (Request (POST:http://vm482:80/_layouts/FormServer.aspx?XsnLocation=http://vm482/FormServerTemplates/SP1SecurityValidationTest_Published.xsn

&SaveLocation=http%3A%2F%2Fvm482%2FSP1SecurityValidationTest&ClientInstalled=true&Source=http%3A%2F%2Fvm482%2FSP1SecurityValidationTest%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1))    

07/20/2011 13:54:03.85           w3wp.exe (0x10CC)                           0x11BC           SharePoint Foundation                     Logging Correlation Data          xmnv   Medium            Name=Request (POST:http://vm482:80/_layouts/FormServer.aspx?XsnLocation=http://vm482/FormServerTemplates/SP1SecurityValidationTest_Published.xsn

&SaveLocation=http%3A%2F%2Fvm482%2FSP1SecurityValidationTest&ClientInstalled=true&Source=http%3A%2F%2Fvm482%2FSP1SecurityValidationTest%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1)      5c0ca3e0-a782-4691-9a79-b2e163e3f0e9

07/20/2011 13:54:03.85           w3wp.exe (0x10CC)                           0x11BC           SharePoint Foundation                     Logging Correlation Data          xmnv   Medium            Site=/   5c0ca3e0-a782-4691-9a79-b2e163e3f0e9

07/20/2011 13:54:03.91           w3wp.exe (0x10CC)                           0x11BC           SharePoint Foundation                     Web Controls                          cm8z    Medium            Failed to get SPGroupName from GroupID. Error Message: Group cannot be found.  Callstack:    at Microsoft.SharePoint.SPGroupCollection.GetByID(Int32 id)     at Microsoft.SharePoint.WebControls.PeopleEditor.set_SharePointGroupID(Int32 value).           5c0ca3e0-a782-4691-9a79-b2e163e3f0e9

07/20/2011 13:54:03.91           w3wp.exe (0x10CC)                           0x11BC           SharePoint Foundation                     General                        8kh7    High    The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.           5c0ca3e0-a782-4691-9a79-b2e163e3f0e9

07/20/2011 13:54:03.91           w3wp.exe (0x10CC)                           0x11BC           SharePoint Foundation                     Runtime                                   tkau      Unexpected     System.Runtime.InteropServices.COMException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.    at Microsoft.SharePoint.Library.SPRequestInternalClass.ValidateFormDigest(String bstrUrl, String bstrListName)     at Microsoft.SharePoint.Library.SPRequest.ValidateFormDigest(String bstrUrl, String bstrListName)          5c0ca3e0-a782-4691-9a79-b2e163e3f0e9

07/20/2011 13:54:03.91           w3wp.exe (0x10CC)                           0x11BC           SharePoint Foundation                     Monitoring                               b4ly      Medium            Leaving Monitored Scope (Request (POST:http://vm482:80/_layouts/FormServer.aspx?XsnLocation=http://vm482/FormServerTemplates/SP1SecurityValidationTest_Published.xsn

&SaveLocation=http%3A%2F%2Fvm482%2FSP1SecurityValidationTest&ClientInstalled=true&Source=http%3A%2F%2Fvm482%2FSP1SecurityValidationTest%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1)). Execution Time=66.2620528586734            5c0ca3e0-a782-4691-9a79-b2e163e3f0e9

Follow

Get every new post delivered to your Inbox.

Join 1,708 other followers

%d bloggers like this: