Search This Blog

Friday, October 14, 2016

How to access to Access request List in SharePoint Online

Browse to the Access Requests list in Internet Explorer/Chrome.

Step 1 : Press F12 to open the F12 Developer Tools window.
Step 2 : Click the Network tab, and then press F5 to enable network traffic capturing.
Step 3 : Refresh the Access Requests page in Internet Explorer. After the page has loaded, press Shift+F5 to stop capturing network traffic.
Step 4 : In the Developer Tools window, double-click the first result in the URL list. This URL ends in "pendingreq.aspx."
Step 5 :In the Developer Tools window, click Response body.
Step 6 :In the search box, type pagelistid:, and then press Enter.

Note : The search highlights the pageListId text.
Copy the GUID that follows the pageListId. The GUID will be between an opening brace ( { ) character and a closing brace ( } ) character as follows:

Note Include the opening and closing brace characters when you copy the GUID. This GUID is the identifier for the SharePoint Online Access Requests list for your organization.
Step 7 : In the browser address bar, enter https://<URL<URL of affected site or site collection>/_layouts/15/ListEdit.aspx?List=<{GUID}>, and then press Enter.

Note In this address, <URL of affected site or site collection> represents the URL for the site collection in which you want to change the access requests (for example, And <{GUID}> represents the GUID that you copied in step 8.
On the Settings page, click Permissions for this list.
Make sure that the Owners group for the site is included in the list of permissions for the Access Requests list. If the Owners group for the site collection does not exist, click Grant Permissions, enter the name of the Owners group for the site in the Share dialog box, and then click Share.
Follow the steps in the “Add the user to the Owners group for the site” section to make sure that the user is included in the Owners group.

Click here for reference Site :

Tuesday, October 4, 2016

Get Login user name and details for SharePoint 2013 Online (Office 365)List New Form using REST API

Display login user name and details on SharePoint online(Office 365) List New Form.

Step 1: Create people picker column(In my case, created 'From'column).

Step 2: Open your List new form using SP Designer add tdFrom id for description filed.

Step 3: Add the below code in script tag and add SharePoint Services and J query reference files(Download latest files).

<script type="text/javascript" src="../../Style Library/Scripts/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="../../Style Library/Scripts/jquery.validate.min.js"></script>
<script type="text/javascript" src="../../Style Library/Scripts/jquery.SPServices-2014.02.min.js"></script>
<script type="text/javascript" >
var fieldName ='From';
var userAccountName= $().SPServices.SPGetCurrentUser();

 //Function to set people picker values
function LoadPeoplePickerDetails()
var url=_spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties"
            //Get properties from user profile Json response  
            var userDisplayName = data.d.DisplayName;
            var AccountName = data.d.AccountName;
     $("#tdFrom [id$='upLevelDiv']").html(AccountName);
     $("#tdFrom [id$='checkNames']").click();

//alert("Error occured in getting current User info");
function getReqData(reqUrl,success, failure) {
url: reqUrl, 
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
error: function (data) {

Step 4: Save the form. Happy Coding!.

Get Login User Details on SharePoint Online (Office 365) Page load using REST API.

Step 1 : Download Plus/Minus images from google and upload these images to SiteAssets/Images document library.

Step 3 : Add below code in new custom list form.

<span id="ProfileDetails">
<img class="imgPlusMinus" alt ="" src="../../SiteAssets/Images/plus.png"/>
<b style="padding-left:5px">Requestor Details</b>
<td colspan="2">
<div id="divRequestorDetails"></div>

Step 4Add the below code in script tag and add SharePoint Services and J query reference files(Download latest files).

<script type="text/javascript" src="../../SiteAssets/Scripts/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="../../SiteAssets/Scripts/jquery.SPServices-2014.02.min.js"></script>
<Script type="text/javascript" src="../../SiteAssets/Scripts/jquery.validate.min.js"></Script>

var plusMinusImgUrl = '../../SiteAssets/Images/';

<Script type="text/javascript">


var invokeAfterEntityEditorCallback =  function(func) {
   var old__EntityEditorCallback = EntityEditorCallback;
   if (typeof EntityEditorCallback != 'function') {
       EntityEditorCallback = func;
   } else {
       EntityEditorCallback = function(result, ctx) {
           old__EntityEditorCallback(result, ctx);
        func(result, ctx);
function onPeoplePickerFieldSet(result, ctx){

 $("#ProfileDetails").click(function () {
        var imgPlusMinus = $(this).find('img');
        var src = (imgPlusMinus.attr('src') == plusMinusImgUrl + 'Minus.png') ? plusMinusImgUrl + 'Plus.png' : plusMinusImgUrl + 'Minus.png';
        $(imgPlusMinus).attr('src', src);
        if (flag == 1) {
            flag = 0;
        } else {
            flag = 1;

//Get Office 365 User Profile
function getO365RequestorUserProfile() {
   var loginName = encodeURIComponent($("div[id*='divEntityData']").attr('key'));
var tblreqdisp=$('#divRequestorDetails #tblRequestorDetails').css('display');
   var userData = [];
   var table = "<table id='tblRequestorDetails' class='tblRequestorDetails' width='900'";
    table+=" style='display:none' ";
   table+="cellSpacing='1' cellPadding='2' bgColor='#dddddd' border='0' valign='top'>";
   var siteUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='" + loginName + "'";
       url: siteUrl,
       type: "GET",
       async: false,
       headers: { "Accept": "application/json; odata=verbose" },
       success: function (data) {
           var profileData = data.d;
           if (profileData != null) {
               var accName = profileData.AccountName.split('|')[2];
               var dispName = profileData.DisplayName;
               var dispEmail = profileData.Email;
               var title = profileData.Title;
               userData.push({ Name: 'AccountName', Value: accName });
               var allProperties = profileData.UserProfileProperties.results;
               if (allProperties.length > 0) {
                   for (var i = 0; i < allProperties.length ; i++) {
                       var department = allProperties[i].Key == 'Department' ? userData.push({ Name: 'Department', Value: allProperties[i].Value }) : "";
                       var manager = allProperties[i].Key == 'Manager' ? userData.push({ Name: 'Manager', Value: allProperties[i].Value.split('|')[2] }) : "";
                       var userName = allProperties[i].Key == 'UserName' ? userData.push({ Name: 'User Name', Value: allProperties[i].Value }) : "";
                       var workEmail = allProperties[i].Key == 'WorkEmail' ? userData.push({ Name: 'Work Email', Value: allProperties[i].Value }) : "";
                       var location = allProperties[i].Key == 'SPS-Location' ? userData.push({ Name: 'Work Location', Value: allProperties[i].Value }) : "";
                       var WorkPhone = allProperties[i].Key == 'WorkPhone' ? userData.push({ Name: 'WorkPhone', Value: allProperties[i].Value }) : "";
                   for (var j = 0; j < userData.length; j++) {
                       table += "<tr><td width='190px' valign='top' class='ms-formlabel' bgcolor='#eeeeee' rowSpan='1' colSpan='1'>" + userData[j].Name + "</td>"
                        + "<td width='400px' valign='top' class='ms-formlabel' style='background-color: white;' rowspan='1' colSpan='1'>" + userData[j].Value + "</td></tr>";
                   table += "</table>";
       error: function (data) {

Step 5 : Save the form. Happy Coding. !

Character or Word Count for Multi line Text box in SharePoint List Forms

Character Count for Multi line text box in SharePoint New,Edit List Forms.

Step 1 : Open your List new/edit form using SP Designer.

Step 2: Add <span> tag under your multi line text filed description in the New form.

<span title="4000" id="commentscount">4000</span><span> Characters Left</span>

Step 3: Add the below code in your New form. and download jquery latest file.

<script type="text/javascript" src="../../Style Library/Scripts/jquery-3.0.0.min.js"></script>
<script type="text/javascript">

//character count
$("textarea[name*='ff43']").keyup(function () {
characterCount('ff43', '#commentscount');
function characterCount(controlID,spanId)
 var controlVal = $("textarea[name*='" + controlID + "']");
 var cmax = $(spanId).attr("title");
 if(controlVal.val().length >= cmax) {
     controlVal.val(controlVal.val().substr(0, cmax));
 $(spanId).text(cmax - controlVal.val().length);            


Step 4: Save the form and refresh your page.

Happy Coding!.

Saturday, October 1, 2016

Multiple Attachments in SharePoint List Using Jquery

We will now explain the most important part of our Multiple upload attachment control in SharePoint List.

Please follow the below steps.

Step 1: Create List column like Attachment1 and datatype is single line text.


Step 2: Open List newform in SharePoint Designer 2013

Step 3: Add the below code under your list filed(Attachment1)

<div id="attachmentsOnAttachC2">
<input type="file" name="AttachC20" id="AttachC20" class="ms-longfileinput" size="56" title="fupldAttachDnbReport"></input>                                                                                                                                       
<input id="attachOKbutton2" type="BUTTON" onclick='CustomOkAttach(this,"AttachC2","Attachment1")' value="Upload" style="width: 12.8em;"/>                                                                                                                                               
<table id="idAttachmentsTable2" border="0" cellspacing="0" cellpadding="0"><tbody></tbody>                                        

Step 4: Add below code in your script file or custom new form aspx page and add jquery reference files in your page.
<script type="text/javascript" src="../../Style Library/Scripts/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="../../Style Library/Scripts/jquery.validate.min.js"></script>

<script type="text/javascript">

<!--code for Multiple Attachments starts -->

function CustomOkAttach(self,idprefix,fieldtitle){
                                                                var g=idprefix+String(FileUploadIndex);
                                                                var idobject=$(self).parent().find('input[id^='+idprefix+']').filter(function () { return $(this).css('display') != 'none' });
                                                                var id=$(idobject).length>0?$(idobject)[0].id:"";
                                                                                var j=c.substring(c.lastIndexOf("\\")+1);
                                                                                var attachmenttable=$(self).parent().find('table');
                                                                                var d=document.getElementById(attachmenttable[0].id).insertRow(-1),h="attachRow"+String(FileUploadIndex);
                                                                                var e=d.insertCell(-1);
                                                                                e.innerHTML='<span dir="ltr">'+c+"</span>&nbsp;&nbsp;&nbsp;&nbsp;";
                                                                                var f=d.insertCell(-1);
                                                                                var l=document.getElementsByName("RectGifUrl")[0];
                                                                                f.innerHTML='<span class="ms-delAttachments"><IMG SRC=\''+l.value+"'>&nbsp;<a href='javascript:CustomRemoveLocal(\""+h+'","'+id+"\",\""+fieldtitle+"\",\""+attachmenttable[0].id+"\",\""+j+"\")'>"+Strings.STS.L_Delete_Text+"</a></span>";
                                                                                var attachmentOnClient=$(self).parent().find('div[id$="'+idprefix+'"]');

                                                                                var i=attachmentOnClient[0],a=document.createElement("input");
                                                                                var k=b.form;
                                                                                /*if(navigator.userAgent.toUpperCase().indexOf('MSIE') >= 0){
                                                                     } else
                                                                                var fieldval=($('input[title="'+fieldtitle+'"]').val()==""?"":$('input[title="'+fieldtitle+'"]').val()+",")+j;
                                                function CustomRemoveLocal(rowid,fuid,fieldtitle,idAttachmentsTableid,filename)
                                                                                var c=document.getElementById("idAttachmentsRow");
                                                                                var a=document.getElementById(idAttachmentsTableid);                                                                          
                                                                                var b=GetAttachElement(fuid);
                                                                                if(typeof b!="undefined"&&typeof b.rows.length!="undefined"&&b.rows.length==0)
                                                                                //if(typeof a!="undefined"&&typeof a.rows.length!="undefined"&&a.rows.length==0)"none";
                                                String.prototype.trimStart = function (c) {
                                                                if (this.length == 0)
                                                                return this;
                                                                c = c ? c : ',';
                                                                var i = 0;
                                                                var val = 0;
                                                                for (; this.charAt(i) == c && i < this.length; i++);
                                                                return this.substring(i);
                                                                c = c?c:',';
                                                                var i=this.length-1;
                                                                for(;i>=0 && this.charAt(i)==c;i--);
                                                                return this.substring(0,i+1);
                                                                return this.trimStart(c).trimEnd(c);

                                                <!--Multiple attachment function end-->


Step 5: Save the form.It's done.