How to code GetGroupCollectionFromUser during form load - InfoPath Dev
in

InfoPath Dev

How to code GetGroupCollectionFromUser during form load

Last post 05-04-2010 08:50 AM by steveyau. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-04-2010 02:37 AM

    How to code GetGroupCollectionFromUser during form load

    Hi there,

    I'm developing a InfoPath 2007 browser form running on MOSS 2007 with form service. When loading a form, I would like to know which SharePoint groups that the current login user belongs to.

     I tested the "GetGroupCollectionFromUser" web service from UserGroup.asmx. This is exactly the WS I need. So I created a secondary data connection for this method.

    Now, my question is on "FormEvents_Loading" module, how can I pass Me.Application.User.LoginName to this secondary data connection, let it execute and then return the result to my code,

    Thanks in advance for your kind help

    Best Regards

    Steve

  • 05-04-2010 03:09 AM In reply to

    • Prasad
    • Not Ranked
    • Joined on 04-29-2009
    • Hyderabad
    • Posts 19

    Re: How to code GetGroupCollectionFromUser during form load

    Create your web service object  and call the method by passing the current user. To get the current user use the following code:

    SPWeb HRFormsWeb = SPContext.Current.Site.OpenWeb();
    SPUser objSubmitter = HRFormsWeb.CurrentUser;

    Regards,
    P V V S V Prasad
    Invesco
    MyBolg
    Filed under:
  • 05-04-2010 08:50 AM In reply to

    Re: How to code GetGroupCollectionFromUser during form load

    Can't I just call the existing web service and pass the current user to it? I already know how to get the current user (me.application.user.loginname) and I've figured out which web service (GetGroupCollectionFromUser) I need. But my point is how to make a call in form loading event.

     Thanks in advance

     Steve

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.