locked
get group name of current user in sharepoint designer 2007 RRS feed

  • Question

  • Hi

    I want get group name of current user  in NewForm/EditForm pages of list in sharepoint designer 2007

    Tuesday, March 8, 2011 11:46 AM

Answers

  • thank all.. I got the solution

     

    <script language="javascript" type="text/javascript" src="http://teams10.sharepoint.hp.com/teams/directo/jquery-1.4.4.js"></script>

    <script language="javascript" type="text/javascript" src="http://teams10.sharepoint.hp.com/teams/directo/jquery.SPServices-0.6.0.js"></script>

      <script language="javascript" type="text/javascript">

     

      $(document).ready(function() {

        $().SPServices({

          operation: "GetGroupCollectionFromUser",

          userLoginName: $().SPServices.SPGetCurrentUser(),

          async: false,

          completefunc: function(xData, Status) {

            if($(xData.responseXML).find("Group[Name='Directo Owners']").length == 1) {

    alert('ok');

            }

          }

       }); 

    }); 

     

    </script>

    • Marked as answer by SPDesigner64 Friday, March 18, 2011 6:03 AM
    Friday, March 18, 2011 6:03 AM

All replies

  • Hi,

    Can you explain what you're trying to do in the form?

     


    Pman
    http://www.pmansLab.com/
    Tuesday, March 8, 2011 1:12 PM
  • i would also like to know some more details of the requirements. I doubt this is possible using designer. It is very much possible using custom code.


    Here to help.
    Tuesday, March 8, 2011 6:39 PM
  • Hi SPDesigner64,

     

    I agree with heretohelp_1984’s opinion. It’s hard to do this through SharePoint Designer. But you can use some custom code instead. Please refer to this article: http://www.codeproject.com/KB/system/everythingInAD.aspx#39. It provides some code sample which may help you.

     

    Thanks & Regards,

    Peng Lei

    Wednesday, March 9, 2011 8:57 AM
  • Hi SPDesigner64,

     

    After some search, I have found that there is a way to get the current user without writing code. Please refer to this article: http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx. I think this is what you want.

     

    Thanks & Regards,

    Peng Lei

    Thursday, March 10, 2011 1:31 AM
  • I want to show hide fields according to groups in EditForm.aspx page.

    any third party free tools like codeplex can also welcome..

    please suggest 

     

    Saturday, March 12, 2011 5:52 AM
  • I cannot use custom code..

    I can use codeplex with  javascript, jquery and free uploadable solutions like that but no coding like c#...

    If you have solution please suggest..

     

    Saturday, March 12, 2011 5:54 AM
  • Hi Peng..

    Thanks for the post..

    but its not permit for me to use Infopath in my project. and also my all forms are developed using sharepoint list so using imfopath to implement this is not proper way.

    please suggest alternative..

    Monday, March 14, 2011 5:08 AM
  • thank all.. I got the solution

     

    <script language="javascript" type="text/javascript" src="http://teams10.sharepoint.hp.com/teams/directo/jquery-1.4.4.js"></script>

    <script language="javascript" type="text/javascript" src="http://teams10.sharepoint.hp.com/teams/directo/jquery.SPServices-0.6.0.js"></script>

      <script language="javascript" type="text/javascript">

     

      $(document).ready(function() {

        $().SPServices({

          operation: "GetGroupCollectionFromUser",

          userLoginName: $().SPServices.SPGetCurrentUser(),

          async: false,

          completefunc: function(xData, Status) {

            if($(xData.responseXML).find("Group[Name='Directo Owners']").length == 1) {

    alert('ok');

            }

          }

       }); 

    }); 

     

    </script>

    • Marked as answer by SPDesigner64 Friday, March 18, 2011 6:03 AM
    Friday, March 18, 2011 6:03 AM