This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
//SP.SOD.executeOrDelayUntilScriptLoaded(AddCustomUserAction, "sp.js"); | |
SP.SOD.executeOrDelayUntilScriptLoaded(DeleteCustomActions, "sp.js"); | |
}); | |
function DeleteCustomActions() { | |
var listTitle = "Pension Files"; | |
context = new SP.ClientContext(); | |
var web = context.get_web(); | |
var list = context.get_web().get_lists().getByTitle(listTitle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$.when(checkPermissions()).then(function(isOnlyContributor){ | |
if (isOnlyContributor){ | |
setInterval(HideSiteContents, 1000); | |
} | |
}); | |
}); | |
function HideSiteContents(){ | |
console.log($("SPAN:contains('Site contents')").length + " called"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PreSaveAction(){ | |
var status = $("[Title~='Status']").val(); | |
if (status == "Final"){ | |
var groupName = "XXX Owners" | |
PermissionManager.BreakInheritance().then(function(data){ | |
console.log("Permission Inheritance Breaked with roles and groups"); | |
}).fail(function(error){ | |
console.log(error); | |
}).then(function (){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SourceList = "SourceList"; | |
var DestinationList = "DestinationList"; | |
$(document).ready(function() { | |
exec(); | |
$("#myBtn").click(exec); | |
}); | |
function exec() { | |
var sourceId = 12; | |
var sourceAttachmentUrl = _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/getbytitle('" + SourceList + "')/Items('" + sourceId + "')/Attachmentfiles"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net; | |
using System.Xml.Linq; | |
using System.IO; | |
using System.Security; | |
using System.Xml; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://msdn.microsoft.com/en-us/library/office/dn600182.aspx#bk_FieldSetShowInNewForm | |
//https://msdn.microsoft.com/en-us/library/office/jj838353.aspx | |
//<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script> | |
//<script> | |
$(document).ready(function(){ | |
var url = "https://unicef.sharepoint.com/teams/DFAM/BudgetSection/_api/web/Lists/getByTitle('XXX')/Fields(guid'XXX')/setShowInNewForm(false)"; | |
$.ajax({ | |
url: url, | |
contentType: "application/json;odata=verbose", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://xxx.sharepoint.com/sites/Site/Web/_api/SP.UserProfiles.PeopleManager/GetMyProperties | |
SharePoint Navigation: _spPageContextInfo.webAbsoluteUrl + '/_api/web/Navigation/GetNodeById(1040)/Children | |
Quick Launch: _spPageContextInfo.webAbsoluteUrl + '/_api/Web/Navigation/GetNodeById(1031)/Children | |
QuickLaunch EndPoint :/_api/web/Navigation/QuickLaunch | |
TopNavigation EndPoint: /_api/web/Navigation/TopNavigationbar | |
Filters on List/Libraray: /_api/web/lists?$filter=IsCatalog eq false and Hidden eq false and BaseType eq 1&$Select=Title,DocumentTemplateUrl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.replaceAll = function(search, replacement) { | |
var target = this; | |
return target.replace(new RegExp(search, 'g'), replacement); | |
}; | |
Array.prototype.contains = function(v) { | |
for(var i = 0; i < this.length; i++) { | |
if(this[i] === v) return true; | |
} | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var G_IsUpdatePending = true; | |
function PreSaveAction(){ | |
AssignQuarter(); | |
if (G_IsUpdatePending){ | |
var dutyStation = GetSelectedTermText('Office') | |
if (dutyStation){ | |
ShowDialog(); | |
$.when(AddCountryToField('Office','Country_','Region_')).then(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_spPageContextInfo.siteAbsoluteUrl; | |
_spPageContextInfo.siteServerRelativeUrl; | |
_spPageContextInfo.webAbsoluteUrl; | |
_spPageContextInfo.webServerRelativeUrl; |
NewerOlder