All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
  Print view

How to get Id of group by script?
Author Message
PostPosted: Thu Aug 20, 2015 12:29 pm 
Offline

Joined: Wed Sep 25, 2013 6:22 am
Posts: 107
Hi,

I want to get the ID of the specify SharePoint group.

Can you give me that function?

Thanks


Top
 Profile  
 

Re: How to get Id of group by script?
PostPosted: Sat Aug 29, 2015 3:04 pm 
Offline

Joined: Tue Mar 08, 2011 7:37 pm
Posts: 275
Hi there,

You can use the LoadPeopleAndGroups internal method to achieve what you want.
signature:
Code:
pf.DataLoader.LoadPeopleAndGroups = function (url, nameFilter, PeopleOnly, groupName, searchInAD, callback)


Here is a sample suitable for SharePoint groups if you have the group name:

Code:
      
     var GroupName = "Your Group Name";
      var loader = new pf.DataLoader();
      loader.LoadPeopleAndGroups(form.Url(), GroupName, false, "", false, function (e) {
         if (e1.ErrorMessage)
         {
            alert("Error: " + e.ErrorMessage);
            return;
         }

         if (e.PeopleAndGroups.length > 0)
         {
            var res = e.PeopleAndGroups[0];
            //*****properties:
            //res.ID;
            //res.Name;
            //res.IsGroup; --> this is always true for sharepoint groups
            //res.Type; --> "User" or "Group"
            //res.LoginName --> not applicable for SharePoint groups
            //res.Email
            //res.IsSiteAdmin
         }
         
      }
      );



Hope this helps

_________________
Spyros Moschovakos

Best Practice Consulting,
http://www.bpc-components.com


Top
 Profile  
 

Re: How to get Id of group by script?
PostPosted: Mon Aug 31, 2015 5:22 am 
Offline

Joined: Wed Sep 25, 2013 6:22 am
Posts: 107
Thank you so much


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Style by custom web design , optymalizacja pozycjonowanie strony pozycjonowanie
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group