Showing posts with label Sharepoint. Show all posts
Showing posts with label Sharepoint. Show all posts

Sunday, September 8, 2019

Hide Unwanted Fields On Calendar Form

<script src="/SiteAssets/Scripts/jquery-1.8.0.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready( function() {
$("TABLE.ms-formtable>TBODY>TR:eq(1)").css('display', 'none');
$("TABLE.ms-formtable>TBODY>TR:eq(5)").css('display', 'none');
$("TABLE.ms-formtable>TBODY>TR:eq(6)").css('display', 'none');
})</script>

Sharepoint hide left menu

<style type="text/css">
 #sideNavBox {DISPLAY: none}
 #contentBox {MARGIN-LEFT: 5px}
</style>

Friday, January 18, 2019

Configure Sharepoint Search


1) Add MultiStringValue to Registry name BackConnectionHostNames
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0

add Site FQDN names
for example: intranet.contoso.com


2) iireset /noforce

https://www.youtube.com/watch?v=LtjkBFVc35M

Saturday, March 31, 2018

SharePoint 2013 Certificate Error Causes Performance Issues

Opening the Application log within Event Viewer showed the following critical error with the text
“A certificate validation operation took 30015.2428 milliseconds and has exceeded the execution time threshold.  If this continues to occur, it may represent a configuration issue.  Please see http://go.microsoft.com/fwlink/?LinkId=246987 for more details.”
to fix this run sharepoint powershell as Administrator:
$SProotCert = (Get-SPCertificateAuthority).RootCertificate
$SProotCert.Export(“Cer”) | Set-Content C:\SProotCert.cer –Encoding Byte
this command will export certificate to C:\ drive
Open the Certificates MMC by opening a Run command and type MMC.  Choose File -> Add/Remove Snap-in.  Select the Certificates Snap-in and click Add.  On the next screen select Computer account and click Next followed by Local computer and Ok.
Right-click on Trusted Root Certificates and choose All Tasks -> Import
certificate C:\SProotCert.cer
These steps fixed the error on most of our SharePoint servers, but it remained on two.  In order to fix the error on the two remaining servers I configured proxy access through Internet Explorer, then from an elevated command prompt ran “netsh winhttp import proxy source=ie”  This configures Windows to use the IE proxy configuration as a default.  The servers were then able to access the internet and verify the certificates.

Tuesday, April 25, 2017

Sharepoint list pop up

<script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
<script language="javascript" type="text/javascript">
        ExecuteOrDelayUntilScriptLoaded(yourFunction, 'SP.js');
        function yourFunction() {
            var options = { url: '/Lists/Notification/AllItems.aspx', title: 'Information ! ', width: 640, height: 400 };
             SP.UI.ModalDialog.showModalDialog(options);
         }
         
         _spBodyOnLoadFunctionNames.push("yourFunction()");
    </script>

Thursday, April 20, 2017

Sharepoint hide ribbonrow bar

<style>
#suiteBar, #s4-ribbonrow
{
    display: none;
}
</style>

Open attachments in new tab script Sharepoint

<script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
<script language="javascript" type="text/javascript">
$(document).ready(function(){
        $("table#idAttachmentsTable a").attr('onclick', '').click(function (event) {
            event.preventDefault();
            var url=$(this).attr('href');
            window.open(url, '_blank');
        });
    });
</script>

Open document in new tab sharepoint

Open document in new tab sharepoint script:


<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
<script language="javascript" type="text/javascript">
$(document).ready(
  function ()
  {
    // has to be on an interval for grouped doc libraries
    // where the actual links are loaded only once a group
    // is expanded
    setInterval(
      function ()
      {
        $("a[onclick*='return DispEx'][target!='_blank']")
          .attr("target", "_blank")
          .removeAttr("onclick");

        // document type icons
        $("td.ms-vb-icon>img[onclick]:not([documentUrl])")
          .click(function (e)
          {
            window.open($(this).attr("documentUrl"), "_blank");
            e.stopPropagation();
            e.preventDefault();
            return false;
          })
          .each(function ()
          {
            $(this).attr(
            "documentUrl",
            $.trim(String($(this).attr("onclick"))
              .split("=")[1]
              .replace(/["'{}]/g, "")
              .split(";")[0])
            );
            this.onclick = null;
          });
      },
      500
    );
  }
);
</script>

Wednesday, March 29, 2017

Sharepoint popup window on main page

To show popup window on Sharepoint page add script editor :


<script type="text/javascript">
    function codeAddress() {
        alert('Your message text');
        SP.UI.ModalDialog.showModalDialog(options);
    }
    window.onload = codeAddress;
</script> 

Sharepoint Birthday List

Create Collums:

  • Username                           > People or Group
  • Birthday                              >  Date Only format
  • Next Birthday                      > Calculated field        
  • Days until B'day                  > Calculated field


Next Birthday contains following formula:
=DATE(YEAR(Birthday)+DATEDIF(Birthday,TODAY(),"Y"),MONTH(Birthday),DAY(Birthday))

Days until B'day contains following formula:
=IF([Next Birthday]=TODAY(),"Happy Birthday","has birthday in "&DATEDIF(TODAY(),[Next Birthday],"d")&" days")

To show only today birthday modify view and add filter Days until B'day contains Happy.

Monday, March 13, 2017

Rename New Discussion Sharepoint

To Rename New Discussion Sharepoint add Script editor :



<script type="text/javascript" src="/SiteAssets/Scripts/jquery-1.9.1.js"></script>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function() {
   jQuery("a:contains('new discussion')").html("text what you want");
 });
</script>


Also you can rename New Picture, new document and ...

Friday, January 27, 2017

Office Web Apps 2013 -2016 Server Install and Configuration

Office Web App

Sharepoint side :

get-SPWOPIBinding - show ofiice web app configuration

Remove-SPWOPIBinding -All:$true -remove office web app from sharepoint

New-SPWOPIBinding -ServerName "OfficewebAppServer FQDN"-AllowHtp- connect sharepoint to owa server

Set-SPWOPIZone -zone "external-https" - use if  users  have external and internal connection

Set-SPWOPIZone -zone "internal-http" - use if  you  have only internal connection

An update conflict has occurred, and you must re-try this action. The object SearchServiceApplication Name={FAST SSA} was updated by {account}, in OWSTIMER (5836) process, on machine {server name}.

An update conflict has occurred, and you must re-try this action. The object SearchServiceApplication Name={FAST SSA} was updated by {account}, in OWSTIMER (5836) process, on machine {server name}.


1. Stop the SharePoint timer service. My  preference is command prompting this: net stop sptimerv4
2. Locate the SharePoint cache folder: \ProgramData\Microsoft\SharePoint\Config\{Guids Folders} . Locate the Guid folder that contains a file called cache.ini. We won’t delete this file. We will delete all files in the folder (but the cache.ini). Recycle bin them if you’re feeling better. Edit the cache.ini file and replace the number in it with something else.
3. Restart the SharePoint timer service, net start sptimerv4
4. Watch the cache (Guid folder) cleaned in step 2 being repopulated with files. Check the cache.ini file’s content, your temporary value will be gone.

An update conflict has occurred, and you must re-try this action

Cannon Add Web application.

An update conflict has occurred, and you must re-try this action

An update conflict has occurred, and you must re-try this action. The object SPAlternateUrlCollection Name=WEBAPPLICATION Parent=SPFarm Name=SharePoint_Config is being updated by DomainName\UserName1, in the w3wp process, on machine ServerName. View the tracing log for more information about the conflict.


  1. Stop the Timer service. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Services.
    2. Right-click Windows SharePoint Services Timer, and then click Stop.
    3. Close the Services console.
  2. On the computer that is running Microsoft Office SharePoint Server 2007 and on which the Central Administration site is hosted, click Start, click Run, type explorer, and then press ENTER.
  3. In Windows Explorer, locate and then double-click the following folder:
    Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID
    Notes
    • The Drive placeholder specifies the letter of the drive on which Windows is installed. By default, Windows is installed on drive C.
    • The GUID placeholder specifies the GUID folder.
    • The Application Data folder may be hidden. To view the hidden folder, follow these steps:
      1. On the Tools menu, click Folder Options.
      2. Click the View tab.
      3. In the Advanced settings list, click Show hidden files and folders under Hidden files and folders, and then click OK.
    • In Windows Server 2008, the configuration cache is in the following location:
      Drive:\ProgramData\Microsoft\SharePoint\Config\GUID
  4. Back up the Cache.ini file.
  5. Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt. 

    Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.
  6. Double-click the Cache.ini file.
  7. On the Edit menu, click Select All.
  8. On the Edit menu, click Delete.
  9. Type 1, and then click Save on the File menu.
  10. On the File menu, click Exit.
  11. Start the Timer service. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Services.
    2. Right-click Windows SharePoint Services Timer, and then click Start.
    3. Close the Services console.
    Note The file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.
  12.  Make sure that the Cache.ini file has been updated. For example it should no longer be 1 if the cache has been updated.
  13. Click Start, point to Programs, point to Administrative Tools, and then click SharePoint 3.0 Central Administration.
  14. Click the Operations tab, and then click Timer job status under Global Configuration.
  15. In the list of timer jobs, verify that the status of the Config Refresh entry is Succeeded.
  16. On the File menu, click Close.


Wednesday, December 7, 2016

Snow effect on Sharepoint site

Add on main page Web Part-Content Editor-Script Editor:

copy this script to script editor.
download snow.gif picture 




<script type="text/javascript">

/******************************************
* Snow Effect Script
******************************************/
  function openwindow(){
window.open("autumn_effect.htm","","width=350,height=500")
}

  //Configure below to change URL path to the snow image
  var snowsrc="snow.gif"
  // Configure below to change number of snow to render
  var no = 10;
  // Configure whether snow should disappear after x seconds (0=never):
  var hidesnowtime = 0;
  // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
  var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width = 800, doc_height = 600; 
  
  if (ns6up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
  } else if (ie4up) {
    doc_width = iecompattest().clientWidth;
    doc_height = iecompattest().clientHeight;
  }

  dx = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
  for (i = 0; i < no; ++ i) {  
    dx[i] = 0;                        // set coordinate variables
    xp[i] = Math.random()*(doc_width-50);  // set position variables
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20;         // set amplitude variables
    stx[i] = 0.02 + Math.random()/10; // set step variables
    sty[i] = 0.7 + Math.random();     // set step variables
if (ie4up||ns6up) {
      if (i == 0) {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");
      } else {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
      }
    }
  }

  function snowIE_NS6() {  // IE and NS6 main animation function
    doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
if (snowdistance=="windowheight"){
doc_height = window.innerHeight || iecompattest().clientHeight
}
else{
doc_height = iecompattest().scrollHeight
}
    for (i = 0; i < no; ++ i) {  // iterate for every dot
      yp[i] += sty[i];
      if (yp[i] > doc_height-50) {
        xp[i] = Math.random()*(doc_width-am[i]-30);
        yp[i] = 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
      }
      dx[i] += stx[i];
      document.getElementById("dot"+i).style.top=yp[i]+"px";
      document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";  
    }
    snowtimer=setTimeout("snowIE_NS6()", 10);
  }

function hidesnow(){
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}


if (ie4up||ns6up){
    snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}

</script>

Wednesday, August 24, 2016

SharePoint Event ID 6482 Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration

  1. Stop the Windows SharePoint Services Timer service (Found in Windows Services)
  2. Navigate to the cache folder

    Drive:\ProgramData\Microsoft\SharePoint\Config
    Locate the folder that has the file "Cache.ini"
    (Note: The Application Data folder may be hidden. To view the hidden folder, change the folder options as required)
  3. Back up the Cache.ini file.
  4. Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt.
  5. Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.

SharePoint Event ID 6482 Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration

  1. Stop the Windows SharePoint Services Timer service (Found in Windows Services)
  2. Navigate to the cache folder

    Drive:\ProgramData\Microsoft\SharePoint\Config
    Locate the folder that has the file "Cache.ini"
    (Note: The Application Data folder may be hidden. To view the hidden folder, change the folder options as required)
  3. Back up the Cache.ini file.
  4. Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt.
  5. Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.

Friday, May 13, 2016

Sharepoint Visio WebPart Hyperlink disable Press CTRL

1. Place a ScriptEditor webpart on the same page that has the Visio webpart
2. Paste the following code into the webpart:

<script type="text/javascript">
// Declare global variables.
var vwaControl;
var vwaPage;
var vwaShapes;
var currentShape;

Sys.Application.add_load(onApplicationLoad)

// Search the SharePoint page to get the WebPartID# for the Visio Web Access Web Part.
function getVWAWebPartID()
{
    // Get a NodesList of all the div tags on the page.
    var divArray = document.getElementsByTagName("div");
    var webPartElementID;
    // Iterate through the NodesList to get the node with the class attribute "VisioWebAccess."
    for (var i = 0; i < divArray.length; i++) {
        var node = divArray[i];
        // Return the first instance of the Visio Web Access Web Part.
        if (node.className == "VisioWebAccess") {
            webPartElementID = node.parentNode.parentNode.id;
            break;
        }
    }
    return webPartElementID;
}

//Apply the handlers in the "OnLoad" event, for we need this each time we click a Shape
function onApplicationLoad()
{
        vwaControl= new Vwa.VwaControl(getVWAWebPartID());
        vwaControl.addHandler("diagramcomplete", onDiagramComplete);
        vwaControl.addHandler("shapeselectionchanged", ClickIt);
        vwaControl.addHandler("shapemouseenter", getShape);
        vwaControl.addHandler("shapemouseleave", unselectShape);
}

//This is the "MouseEnter" event that fires when you enter/hover a Shape
getShape = function (source, args)
{
   currentShape=null;
   currentShape=vwaShapes.getItemById(args) ;
}

//This is the "MouseLeave" event that fires when the mousecursor leaves/unselects the shape
unselectShape = function (source, args)
{
currentShape=null ;
}

//The event that fires when a diagram is loaded
function onDiagramComplete() {
        try {
            vwaPage = vwaControl.getActivePage();           
            vwaShapes = vwaPage.getShapes();  
            currentShape=null;                                         
        }
        catch (err) {
            //alert(err);
        }
}

//The function that enables the single click!
function ClickIt()
{
 if (currentShape != null)
 {
 var drawingURL = vwaControl.getDiagramUrl();
  while(drawingURL.indexOf('%20')>0)
  {
  drawingURL=drawingURL.replace('%20',' ');
  }
 vwaPage = vwaControl.getActivePage();
 var vwaPageName = vwaPage.getId();
 var n=currentShape.getHyperlinks();
  if (n.length>0 )
  {
  vwaPages = vwaControl.getAllPageIds();
  var pageCount = vwaPages.length;
   // Get page ID from array of pages IDs.
   for (var i = 0; i < pageCount; i++)
   {
   vwaPageId = vwaPages[i];
   //Set variable PageName to the URL of the Shape
   vwaPageName=n[0].value;
    //Clean up the URL
    while(vwaPageName.indexOf('%20')>0)
    {
    vwaPageName=vwaPageName.replace('%20',' ');
    }
    //If the PageID exists in the PageName (URL of the Shape)
    if (vwaPageName.indexOf(vwaPages[i])>0)
    {
    //HERE IT IS!! OPEN THE SHAPE WITH A SINGLE CLICK!!!
    //By using "OpenDiagram" instead of "setActivePage" the Shape gets deselected after the click!
    vwaControl.openDiagram(drawingURL, i);
    //Call "onApplicationLoad" to set the handlers again for the 'new' Diagram
    onApplicationLoad();                                                                      
    break;
    }
   }  
  }
 }
}
</script>