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 SetAllFieldsRequired(bRequired){ | |
var list = rWeb.get_lists().getByTitle('IndexNumberRequestor'); | |
var fields = list.get_fields(); | |
rClientContext.load(fields); | |
rClientContext.executeQueryAsync(function(){ | |
var fieldEnumerator = fields.getEnumerator(); | |
while(fieldEnumerator.moveNext()){ | |
var field = fieldEnumerator.get_current(); | |
console.log(field.get_title()); | |
var msg = bRequired ? 'Set Required for ' : 'Set Not Required for '; |
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
$("[ID*='RequestorDutyStation']").find('[contenteditable]').attr('contenteditable','false').end().find('IMG').hide(); |
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
log("CountryRegion"); | |
function AddCountryToField(dutyStationFieldName,countryFieldName,regionFieldName){ | |
var d = $.Deferred(); | |
var DutyStationTermsetName = "6e8c6e86-6359-4685-9284-1fcbf0629093"; //DutyStationTermsetID | |
var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(rClientContext); | |
var termStores = taxSession.get_termStores(); | |
var termStore = taxSession.getDefaultSiteCollectionTermStore(); | |
var termSet = termStore.getTermSet(DutyStationTermsetName); |
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
//An Example of Using SPTrick, uses SetValueForPeoplPicker & GetFieldControl | |
$.when( $.SetValueForPeoplPicker('Requestor',G_CurrentUserEmail)).then(function(){ | |
$.GetFieldControl('Requestor').attr("disabled","disabled").find(".sp-peoplepicker-delImage").hide(); | |
}); |
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 GetUserProfileProperties() { | |
var userProfileProperties; | |
var peopleManager = new SP.UserProfiles.PeopleManager(rClientContext); | |
userProfileProperties = peopleManager.getMyProperties(); | |
rClientContext.load(userProfileProperties); | |
rClientContext.executeQueryAsync(onRequestSuccess, onRequestFail); | |
function onRequestSuccess() { | |
//https://unicef-my.sharepoint.com/_layouts/15/EditProfile.aspx?UserSettingsProvider=dfb95e82-8132-404b-b693-25418fdac9b6 | |
//The list of properties |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<%@ Page Language="C#" %> | |
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> | |
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<meta name="WebPartPageExpansion" content="full" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Diable Thrid Level TermSet</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=10" /> |
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 rextension = { | |
CreateTableFromJson: function (options){ | |
/* | |
var options ={ | |
data: results, | |
container: "#jsontotable", | |
FieldNotToPopulate: ["id","uri","etag","type","Id","TermGuid","type","Label","WssId"] | |
}; | |
*/ | |
console.log(options); |
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 parseTaxonomySearchResultValue(val){ | |
var taxValue = {TermSetGuids: [], TermValues: []}; | |
var parts = val.split(';'); | |
parts.forEach(function(part){ | |
if (part.startsWith("GP0|#")) //term? | |
{ | |
var termGuid = part.replace("GP0|#", ""); | |
taxValue.TermValues.push({ TermGuid: termGuid}); | |
} | |
else if (part.startsWith("GTSet|#")) //term set? |
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; |
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(){ |
OlderNewer