Wednesday, 1 August 2018

How to add conditional style in w2ui grid to highlight individual cell?


Add following while preparing records array:

    'w2ui':{style: {
      10: ($(this).attr("ows_Column1")=="Approved")?"background-color: green":"red",
      11: ($(this).attr("ows_Column2")=="Approved")?"background-color: yellow":"",
      }}


To highlight specific header:

<style type="text/css">
td[col="6"].w2ui-head,td[col="7"].w2ui-head {
    border:dashed 2px #0099f8 !important;
    font-weight:bold;
}
</style>


Tuesday, 31 July 2018

How to add more than 5 conditions in InfoPath form's rule?


1. Add the first condition.

2. Change the type of condition to 'The expression'.

3. Open a text editor and paste the above expression.

4. Do the same for all the conditions.

5. Formulate the overall conditions by adding and, or between the above conditions.

6. Add the final expressions as a single condition (The expression).


Note: The final expression should be typed in a single line of the text editor.

Wednesday, 2 May 2018

SharePoint: How to use IF condition in InfoPath form formula?


if (BoolCondition) {
   TrueResult
}
else {
   ElseResult
}


becomes

concat(

substring(TrueResult, 1, (BoolCondition) * string-length(TrueResult)),

substring(ElseResult, 1, (not(BoolCondition)) * string-length(ElseResult)))


Source: https://blogs.msdn.microsoft.com/infopath/2006/11/27/conditional-default-values/

Tuesday, 17 April 2018

[Solved] SPServices : GetListItems not returning all items from SharePoint list?


'GetListItems' will return items from default list view only.

To overcome this use the following filters:

var cmlQuery="<Query><Where><Neq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Neq></Where></Query>";

CAMLQuery: cmlQuery,  //Include items which are filtered-out in default view
CAMLRowLimit: 0,  //Override default view row-limit

Friday, 13 April 2018

How to increase the width of a column in SharePoint 2013 list?


Add the following in script editor:

<style type='text/css'>
.ms-vh-div[DisplayName='Column Display Name']
{
  width:400px;
}
</style>

Thursday, 12 April 2018

Friday, 6 April 2018

How to mass check-in SharePoint library files?


Here is a way to check in multiple files at once:

First, if you don't have ownership of the files then go to library settings. Click on 'Manage files with no checked in version'. Select all and take ownership.

If not already available, create a view with filter as following: 'Check Out To' = [Me].

Go to content and structures from site settings. Go to the view you just created. Select all files and check-in using the action tab.