Wednesday, December 2, 2015

Display People Picker value.

Recently had to dive back into Infopath 2010 and I had an issue where I wanted to display the value of a people picker for a record but essentially have it read only.  Most of the solutions I found said to create a Text Box and assign it a value of the people picker.  I hated this solution because it creates another column in the SharePoint list, forcing me to administer duplicate data.  Blehg.

I found a better way.  Much like the above solution but instead of a Text Box, use the Calculated Value control.  All the same steps but instead the value is calculated at runtime instead of stored in a SharePoint list.

Steps:

  1. Under the Home tab, look for Controls and click on Calculated Value.  This will bring up the Insert Calculated Value dialog box.
  2. Click on the function button (fx) bringing up the Insert Formula dialog box.
  3. Click on the Insert Field or Group button bringing up the Select a Field or Group dialog box.
  4. People pickers will not be displayed in the fields list.  You have to click on the Show advance view link at the bottom of the dialog box to change the fields view.
  5. What you should now see is a tree view of your data, most likely collapsed. 
    1. Expand dataFields
    2. Expand my:SharePointListItem_RW and find your people picker field.
    3. Expand your people picker field.
    4. Expand pc:Person.
    5. Click on DisplayName.
    6. Click the Ok buttons until you are back to your form.
You now have a calculated value control which populates with that records people picker value without having to store or administer unnecessary data.

Monday, January 19, 2015

No Provider Schema

Scenario:  You have a SharePoint 2013 list and have just created a custom New/Edit/Display form and you want to connect a couple of webparts together but SharePoint is reporting a "No Provider Schema" error.  Ok, what is that?  How do I fix it?  You spend several hours searching for an answer, most of which do not apply or are useless.  Finally you stumble upon this post.  I hope it helps.

I compared an out of the box form with connected webparts with a custom form to see the difference.  I noticed two lines of code encapsulating the webpart connections so I decided to copy just those lines (omitting the connections since they will not apply on the custom form) and pasted them into the new form, inside the table and just before SPDataSource if you have one.  Example below.  Code in question is highlighted.

</SharePoint:UIVersionedContent>
 <table class="ms-core-tableNoSpace" id="onetIDListForm">
  <tr>
   <td>
  
     <WebPartPages:SPProxyWebPartManager runat="server" ID="__ProxyWebPartManagerForConnections__">
  <SPWebPartConnections></SPWebPartConnections></WebPartPages:SPProxyWebPartManager>

  
   <WebPartPages:DataFormWebPart runat="server" ......

Once the code was in place, I was able to use the SharePoint web interface to connect webparts together.  I was also able to use SharePoint Designer to do the same.

Correction, I was only able to establish the connection between webparts using SharePoint Designer.  The web interface still reported "No Provider Schema" error.  Hmm...

This solution has only been tested with SharePoint 2013.  I assume it would be the same for 2010 however I cannot guess about 2007.