Saturday, 30 March 2019

[Solved] SharePoint workflow 'Calculated' column cannot be used as lookup.


Error: SharePoint workflow 'Calculated' cannot be used in the query filter.

Instead of preparing the unique key using a calculated column, create a workflow to concatenate the columns and update the unique key (to fetch the row later).

Similarly, use the string builder in SharePoint designer to lookup for the desired item.

This can also be used to look up more than one column in SharePoint designer.


Note: This is not the recommended way for lists with 100s of items. Instead, prepare the concatenated key in the source data(e.g. Excel) or in the InfoPath form.

Wednesday, 27 March 2019

Sunday, 24 March 2019

How to show loading message/image during function call in JavaScript?


HTML

<select class="options-selector" id="drpAbcOptions" onmousedown="$('#loader').show();" onmouseup="$('#loader').hide();" onchange="callSomeFunction()"></select>

<div id="loader" style="display:none;"></div>

CSS

#loader {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 50px;
  height: 50px;
  margin: -75px 0 0 -75px;
  border: 8px solid #f3f3f3;
  border-radius: 50%;
  border-top: 8px solid #3498db;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }

}


Script

$(document).ready(function(){
     $('#loader').show();
});

$(window).on('load', function (){
  setTimeout(function (){
   try
   {
       loadData();
   }
   catch(ex){}
   finally
   {
       $(loader).hide();
    }
  }, 1000);
});

Friday, 22 March 2019

How to refresh w2ui grid on dropdown menu index change?


    function onSelectedIndexChange()
   {
    //prepare records using loop
   
    try
     {
          w2ui['grid']. destroy ();
     }
     catch(ex){}

    defineGrid(); // call the function to define grid columns and other properties
    w2ui['grid'].records = listData;
    w2ui['grid'].refresh();
    }

Friday, 1 March 2019

SharePoint Designer Workflow: How to add if condition in 'Transition to stage' block?


To have a conditional 'go to' statement in 'Transition to stage' block, first remove the 'go to' statement and then add the if condition, followed by the required 'go to' statement.