Archive
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
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#
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
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
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)
I then created a validation rule for the PhoneNumber control, for the condition I used “PhoneNumber” “does not match pattern”
and selected “Select a pattern…” in the final box, this brings up the Data Entry Pattern dialog box.
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.
With the addition of a screen tip the validation rule is complete
InfoPath 2010 People picker control
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.
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.
To get around this drawback I had to write a small workflow that fired when the form was submitted.
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.
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
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:
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
When the user switches views in the form, a Security Validation Error occurs:
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
Auto height plain text box issue fixed in InfoPath / Form Services 2010 #in #SharePoint #SP2010
A quick post to say that the InfoPath / Form Service 2010 issue I was having at one of my clients has now been fixed and is included as part of the SharePoint 2010 – April 2011 Cumulative Update.
My description of the issue can be found here: https://ghamson.wordpress.com/2010/10/17/form-services-infopath-2010-bug-found-in-multi-line-plain-text-boxes/
Microsoft KB Articles
- InfoPath Hotfix: http://support.microsoft.com/kb/2516485
- Project Server 2010 – April 2011 CU: http://support.microsoft.com/kb/2512801
- SharePoint Server 2010 – April 2011 CU: http://support.microsoft.com/kb/2516485
- SharePoint Foundation 2010 – April 2011 CU: http://support.microsoft.com/kb/2512804
I would also like to take this opportunity to thank the Microsoft support and product teams in working with us to detail the issue and come to a resolution. We are testing the go live environment with April CU 2011 as I write this and the fix will dramatically improve the UI for the custom forms that we have developed.
Splitting a date into Year, Quarter and Month for analysis purposes in InfoPath 2010 #SP2010 #SharePoint #in
Last week at a client I had the requirement to split a date into various parts for various uses on the form and the list for analysis purposes.
Although not a lot of hard work (it was done and dusted within 15 minutes). I thought I would share some of my findings and the formulas and rules I used to achieve my requirement.
The Starting Point – Fields and Settings
Initially we need some fields to store the data:
Column Name | Column Type | Column Settings | Comments |
Activity Date | Date and Time | Date Only | All other fields will be derived from this column |
Year | Single Line Of Text | No. Characters: 4 | Stored as text |
Quarter | Number | No. Decimals: 0 Min: 1 Max: 4 |
|
Month | Single Line Of Text | No. Characters: 9 | For storing Month names.
Example: |
Month No. | Number | No. Decimals: 0 Min: 1 Max: 12 |
|
Month No. Text | Single Line Of Text | No. Characters: 2 | Value Example: – 01 – 09 – 12 To aid with sorting when combining with Year values. Example (YYYY MM): |
Formula / Default Values:
Column Name | Formula / Default Values | Comments |
Year |
substring(../my:Activity_x0020_Date, 1, 4) |
SharePoint stores dates in the following format to avoid regional issues:
– YYYY-MM-DDTHH-MM-SSZ Example: – 2011-01-24T22-25-00Z The formula to the left takes this into account. |
Month No. | substring(../my:Activity_x0020_Date, 6, 2) | As a number field, this will automatically take off the preceding zero. |
Month No. Text | substring(../my:Activity_x0020_Date, 6, 2) | As a text field, the preceding zero will be retained. |
NB: By copying and pasting the default values above, it is likely that you will need to remap the field selector(../my:Activity_x0020_Date) to accommodate the date field in your form.
Rules:
Column Name | Condition | Action | Run Remaining Rules |
Month No. | Month No. >= 10 | Set Quarter = 4 | No |
Month No. >= 7 | Set Quarter = 3 | No | |
Month No. >= 4 | Set Quarter = 2 | No | |
Month No. >= 1 | Set Quarter = 1 | No | |
Month No. Text | Month No. Text = “01” | Set Month = “January” | No |
Month No. Text = “02” | Set Month = “February” | No | |
Month No. Text = “03” | Set Month = “March” | No | |
Month No. Text = “04” | Set Month = “April” | No | |
Month No. Text = “05” | Set Month = “May” | No | |
Month No. Text = “06” | Set Month = “June” | No | |
Month No. Text = “07” | Set Month = “July” | No | |
Month No. Text = “08” | Set Month = “August” | No | |
Month No. Text = “09” | Set Month = “September” | No | |
Month No. Text = “10” | Set Month = “October” | No | |
Month No. Text = “11” | Set Month = “November” | No | |
Month No. Text = “12” | Set Month = “December” | No |
The Result:
Form Services / InfoPath 2010 Bug found in Multi-line Plain Text boxes
- Form Control: Text Box
- Read-only – No
- Enable spelling checker – Yes
- Enable AutoComplete – Yes
- Multi-line – Yes
- Height: Auto
- Form Type: Web Browser Form (2010)
- Browser: Internet Explorer 7, 8, Google Chrome
- Image Before:
- Image After:
- Browser: Firefox 3.6.10
- Before:
- After: