Showing posts with label InfoPath. Show all posts
Showing posts with label InfoPath. Show all posts

7.07.2014

SharePoint 2010 - Change Column Types

Sometimes InfoPath doesn't promote fields they way you would like to the SharePoint list. For instance, currency is promoted to a list as a decimal, or a decimal is promoted as an integer. Powershell to the rescue!

Output all of the list columns
$w = Get-SPWeb "https://site";   
$l = $w.GetList("https://site/listname/");
$l.Fields | sort StaticName,Type | ?{$_.CanBeDeleted -eq $true -and $_.Hidden -eq $false} | FT Title,StaticName,Type;


Change Column Type
$w = Get-SPWeb "https://site";   
$l = $w.GetList("https://site/listname/");
 
$column = $l.Fields["Amount Due"];
#$column.AllowDeletion = $false;
#$column.Sealed = $true;
$column.Type = "Number";
$column.Update($true);
$web.Dispose();

1.29.2014

SharePoint 2010 - InfoPath - Web Browser Settings

There is a glitch in the form rendering processes. Even with all the apparent settings set correctly in Central Admin and in the Form Library itself, the form still tries to open in the client filler application. There are some workarounds.
  1. Add this query parameter to the URL string. (Documentation)
    https://intranet.mysite.org/FormLibrary/Forms/template.xsn?OpenIn=Browser
  2. Using powershell to force the settings on the library:
       http://technet.microsoft.com/en-us/library/ff805082(v=office.14).aspx
       Set-SPInfoPathFormsService -AllowUserFormBrowserRendering $true
The actual fix for me was to just do a full publish of the form again. For whatever reason the "Quick Publish" did not correct the issue.

10.16.2013

SharePoint 2010 - InfoPath Time Picker

Creating a time picker in InfoPath is a real pain. I opted to not create the sharepoint lists and just load the options manually within the form. To pull this off you need to create 4 fields.
  1. MyDateTime = DateTime control. The final location of the information. Not actually used in the form. Just a container for storage.
  2. mDatePicker = Date control.
  3. mHourPicker = Text box in drop down format. Options are 00 - 23.
  4. mTimePicker = Text box in drop down format. Options are 00,15,30,45.
The concatenation used to apply the final value to MyDateTime is actually this, not what was in the article.
concat(mDatePicker, “T”, mHourPicker, “:”, mMinutePicker, “:00″)

This article does explain it quite well.
http://www.moderntoad.com/2012/02/23/infopath-date-hour-and-minute-picker-to-replicate-sharepoint-experience/

4.16.2013

InfoPath - Line Breaks on Calculated Values

File this one under A for annoying. However, this work around does work for creating multiline, calculated textbox values without resorting to C# code.
http://blogs.msdn.com/b/infopath/archive/2005/03/04/385577.aspx

4.08.2013

InfoPath 2010 - DateDiff

InfoPath dates are stored in the format YYYY-MM-DD

To extract the day number of a date:
number(substring(field1, 9, 2))

To extract the month number of a date:
number(substring(field1, 6, 2))

To extract the year number of a date:
number(substring(field1, 1, 4))