Showing posts with label javascript:;. Show all posts
Showing posts with label javascript:;. Show all posts

Friday, March 18, 2016

Resource Throttling in SharePoint 2013



  • monitoring and throttling server resources and large lists for Web applications. 
  • its enables you to control resource utilization during peak usage and prevent user activity from negatively affecting server performance. 



  1. General Settings Ribbon, select Resource Throttling.
  2. Enter values for the List View Threshold option.
  3.  This limits queries within a list to guard against performance degradation with too many list items. 
  4. In SharePoint Server 2013, a list can support up to 50 million items. 

Thursday, March 17, 2016

WSP gets stuck in "Deploying"


  • stsadm -o execadmsvcjobs on the server running Central Admin
  • Install-SPSolution has only the -Force, 
  • Check for Sharepoint 2013 Timer service






Add-SPSolution –LiteralPath "d:solution.wsp" 

install solution and we executed the following command:

Install-SPSolution -Identity "solution.wsp" -WebApplication http://peakfinders.com/  –GACDeployment

Import subsite and Site Collection in SharePoint power shell script

Import the subsite

STSADM:

stsadm -o import -url "http://sharepointsite/sites/order/" -filename D:\backup.cmp -includeusersecurity -versions 4

Powershell:

Add-pssnapin microsoft.sharepoint.powershell

Export-SPWeb -identity "http://sharepointsite/sites/order/"  -path D:\backup.cmp -includeusersecurity  -force

Export the Subsite moved to site Collection Using PowerShell

Export the subsite


STSADM:

stsadm -o export -url "http://sharepointsite/sites/order/" -filename D:\backup.cmp -includeusersecurity -versions 4


Powershell:


Add-pssnapin microsoft.sharepoint.powershell

Import-SPWeb -identity "http://sharepointsite/sites/order/"  -path D:\backup.cmp -includeusersecurity  -force

Tuesday, March 15, 2016

calculate the number of the week based on a date in a list?

Week starts on monday. Depending on your regional settings you have to replace the ; with ,

Example:

=IF(INT((StartDate-DATE(YEAR(StartDate);1;1)+(TEXT(WEEKDAY(DATE(YEAR(StartDate);1;1)-1);"d")))/7)=0;52;INT((StartDate-DATE(YEAR(StartDate);1;1)+(TEXT(WEEKDAY(DATE(YEAR(StartDate);1;1)-1);"d")))/7))


Example:

=INT(([Start Date]-DATE(YEAR([Start Date]),1,1)+(TEXT(WEEKDAY(DATE(YEAR([Start Date]),1,1)),”d”)))/7)+1

How to Backup & Restore a SharePoint Designer workflow and add it another site?


  • Go to the site you have the workflows on
  • Select Site Actions -> Edit in SharePoint Designer.
  • Select “All Files” in the Navigation, then click “Workflows”
  • Right-Click the workflow And go to “Copy”
  • SharePoint Designer. Go to your destination site.
  • Go to Site Actions -> Edit in SharePoint Designer.
  • Right Click and choose “Paste”. 
  • The workflows should be there, but they are not associated with the list 
  • SharePoint recognizes and attaches workflows to Lists and Libraries using their ListID. 
  • We can change that through the .xoml.wfconfig.xml
  • Select the “All Files” again in the navigation, then click “Workflows”, then click the workflow name.
  •  Open With -> SharePoint Designer (Open as XML).
  • Delete the ListID, and paste the ListID you copied earlier here.

Wednesday, March 2, 2016

How do I get results to open in new tab?

html = html + "< a href='" + this.LinkingUrl + "' target='_blank' >" + this.Name + "</a>"

Tuesday, February 23, 2016

Set Div position to Mouse position with jQuery

we are  trying to position my Div wherever the user clicks on textbox.Show a hidden div at mouse position when a text box is clicked
Here is the full code:
Jquery:

var id4com="";
 $('.txt4com').on('click',function (e) {
e.preventDefault();
// $('#4com').css( 'position', 'absolute' );
       var o = {
            left: e.pageX,
            top: e.pageY
        };
        $("#4com").show(200).offset(o);

 id4com=$(this).attr('id'); 
   });
 $(".sp4com").click(function(){

  $("#"+id4com).val($(this).text())
$('#4com').toggle();
 });
HTML

<div id="4com" class="divplace" style="min-width:100px;background: #fff; overflow: auto; border: 1px solid #999; display: none; ">

<span class="sp4com">LADC</span><br>
<span class="sp4com">All ZNA</span><br>
<span class="sp4com">Fore/ODC</span><br>
<span class="sp4com">LADC</span><br>
<span class="sp4com">ODC</span><br>
<span class="sp4com">ZNA</span><br>
<span class="sp4com">Foremost</span><br>
<span class="sp4com">ZDU (UUG)</span><br>
<span class="sp4com">Canada</span><br>
<span class="sp4com">REM</span><br>
<span class="sp4com">Other</span><br>
<span class="sp4com">N/A</span><br>
</div>

Friday, February 12, 2016

How to remove left navigation and ribbon controls from Newform, editform and viewform of a Sharepoint List

User pass query string IsDlg=1 for list OOTB list forms,

 IsDlg=1
 IsDlg=0

Wednesday, February 3, 2016

How to format currency by using JQuery?

HTML

<input type="text" id="txtvalue" />
Javascript 


var format = function(num){
var str = num.toString().replace("$", ""), parts = false, output = [], i = 1, formatted = null;
if(str.indexOf(".") > 0) {
parts = str.split(".");
str = parts[0];
}
str = str.split("").reverse();
for(var j = 0, len = str.length; j < len; j++) {
if(str[j] != ",") {
output.push(str[j]);
if(i%3 == 0 && j < (len - 1)) {
output.push(",");
}
i++;
}
}
formatted = output.reverse().join("");
return("$" + formatted + ((parts) ? "." + parts[1].substr(0, 2) : ""));
};
$(function(){
    $("#txtvalue").keyup(function(e){
        $(this).val(format($(this).val()));
    });
});