问题 InfoPath 2010 - Get a Mangers Staff/Users into a list from AD or SharePoint

  • Tuesday, April 24, 2012 10:55 AM
     
     

    Ok, So I want a manger to be able to see a list of the staff that are under them in an infopath form. The manager will then select which staff are going to be added to another list. Any ideas? I have explored the UserProfileService but can't seem to work out if there are any methods, like, getUsersStaff. I cant work out if i can use a combo of the other methods. Ideally I want the solutions to be non code. Any hints or points in directions would be most welcome.

    My overall problem:

    I will outline my overall problem in case someone can see where I am being silly and that there is an easier way around it.

    I have a list of training events that a member of staff will create. For each of these events I want a manager to be able to book their own staff onto it.

    Solution1: I created a list that was going to hold the events. This had an infopath form and a workflow that when a new event was created it populates a calendar. I was then going to have the workflow auto create a site meeting workspace (but would need to download a web service package from: http://ilovesharepoint.codeplex.com/wikipage?title=Create%20Site%20Action&referringTitle=Workflow%20Actions%20for%20SharePoint%20Designer%202010). Not a massive problem.

    Solution2: Same as above but instead of creating a workspace, just create a list. Problem: Cant create lists from workflow without custom code (which I am yet to learn how to do).

    Solution3: Pre-create one list to hold all attendees. This will then allow me to add an attendee to the list using workflow. The list will contain the username and event that they are on.

    So I am going for solution3. But, I cant seem to work out how to get just the managers staff in a list and populate to a anotehr list.

    If anyone can help, thanks.


    • Edited by Chaney2004 Tuesday, April 24, 2012 10:55 AM
    •  

All Replies

  • Wednesday, April 25, 2012 10:11 AM
    Moderator
     
     

    Hi Chaney2004,

    As far as I know in the OOTB  userprofileservice.asmx  web service ,there is not a function to get staffs of a manager .You need to create your own web service to get the staffs .Or you can use a custom list to store the relationship between the manager and staffs .Then use a data connection to get value from the list .Then bind a control on the form to get the value form the data connection with a filter .

    For more information about create a new web service ,please refer to this site:

    Walkthrough: Creating a Custom ASP.NET Web Service: http://msdn.microsoft.com/en-us/library/ms464040.aspx

    Thanks

    Entan Ming

    TechNet Community Support

  • Wednesday, April 25, 2012 8:03 PM
     
     
    You'll have to have AD profiles sync'd with sharepoint and then use userprofileservice.asmx web service in infopath to get the manager of a staff
  • Friday, April 27, 2012 1:16 PM
     
     

    Cheers Entan.

    I will play around with that. It was the response I was expecting (no OOTB functionality, but I was hopeful). Looks like I will have to go down the root of coding.

  • Friday, April 27, 2012 1:17 PM
     
     

    Thanks Rotor,

    I can already get the Manager of a user. However what I was actually after was the reverse process. I have a manger, I want all of his/her staff.

    Thanks

  • Tuesday, May 01, 2012 3:56 PM
     
     
    I think that can be done with filtering
  • Friday, May 11, 2012 8:04 AM
     
     

    Hi Rotor,

    Please can you be more specific? So return all users but only show those that have the current user as their manager? Can this be done on a list of users?

    Thanks

    Mark