Thursday, March 10, 2016

InfoPath 2010: concatenating account IDs to show on a single field from a SharePoint secondary data connection with a Person field set to allow multiple

When a multi user person field in a SharePoint list comes over to InfoPath as a secondary data connection, the Person field is a repeated field and as the account IDs are under it, also shows as a repeated field.  This is evident if you just drag that field from the Fields screen onto the form. 

To get the accountIDs to show in one field, we will utilize the eval() and concat() functions:

where 'AccountId' is the under person field you want to concat (obviously).  Here we are using claims authentication with SharePoint, so have to use the substring function to remove extra chars "i:0#.w|". 

End result will be as follows:
<domain>\user; <domain>\user2; <domain>\user3

Wednesday, September 25, 2013

SharePoint search returns ALL results from web application

Solution: To limit the search result to a certain scope, edit the search results page and on the Search Core Results web part -> 'Modify Shared Web Part', under Miscellaneous -> put in the name of the scope.

Wednesday, June 26, 2013

User seeing all folders, subfolders and files on allitems.aspx

Problem: One user is seeing all folders, subfolders and files (all flattened out) on the all documents view (public view).

Solution:  Go to 'Tools' -> 'Internet Options', and delete all the temporary files.  Might have to do it manually by going to 'Settings' under browsing history and click on 'view files'.

Tuesday, April 30, 2013

Using webpart in masterpage generates error on subsites

Using a dataview webpart in a masterpage created the following error on subsequent subsites:
“Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator.”
Reason:  Subsite doesn't have that list specified on the webpart and doesn't know to look at the root.

Resolution: Add the following parameter (in green) in the <SelectParameters> section:

        <asp:Parameter Name="ListName" DefaultValue="Tasks" />
        <asp:Parameter Name="WebID" DefaultValue="RootWeb" />    </SelectParameters>

Wednesday, April 4, 2012

Error on SharePoint list: Invalid number value...

Got the following error while working on a list with BDC data columns:
Invalid number value.  A number field contains invalid data. Please check the value and try again.
Cause: On the database where the BDC is pulling data from, one of the columns was changed from type of Int32 to a String.  Even though the xml definition file was updated accordingly, this error comes when you try to save the list item after picking a BDC item.

Resolution:  Go to the list settings, click on the BDC column, uncheck the 'problem' column (i.e. the column that changed type), go back and the problem is gone.  You can re-add the column back by checking it.  Refresh.  All the data will be refreshed and no more errors.

Monday, March 19, 2012

Expand the multiselect box in SharePoint

To make the multselect boxes larger, put the following code in a 'content editor web part' and set it to hidden.  Adjust to your own needs.

<script src=""></script>
<script type="text/javascript">
            $(document).ready(function() {                
                        $('.ms-long select').parent('div').css('width', '320');
                        $('.ms-long select').css('font-size', 'xx-small');
                        $('.ms-long select').css('width', '100%');

Wednesday, December 14, 2011

Toggle Ribbon with JQuery

To toggle 2010's ribbon neat and short:

Reference JQuery:
<script src="/sites/inet/_js/jquery-1.4.4.min.js" type="text/ecmascript"></script>
Put this either in a separate .js and reference the js file:
    $('#toggleribbon').click(function() {

Put this some where.  This is what you will click to toggle the ribbon:
<img id="toggleribbon" src="/../../images/imgToggle.jpg"/>

Wednesday, November 23, 2011

Custom form did not stick to list

A site owner customized a new form for a list.  He then went into SharePoint Designer and went to list properties to set the form as the 'new item form'.  When he clicked OK, the setting did not seem to be saved and reverted back to the original newform.aspx. 

Solution: Under 'List Properties' -> 'Supporting Files' (4th tab),  make sure the second drop down 'Content type specific forms' is set to 'item', then go and select the new customized form:

Wednesday, November 16, 2011

Cannot connect to sql express 2008, server doesn't support requested protocol

Got the following error:

Need to enable TCP/IP on Sql Server Configuration Manager:

Once TCP/IP is enabled, restart the SQL Instance:

Now connecting from VS 2010 works. 

Monday, November 14, 2011

Hide left nav

Hiding the left nav:

<script type="text/javascript"> 
    $("#MSO_ContentTable").css("margin-left", "-10px");  //adjust for the margin

The css: