AD Service: How-To Set Field to GetMyInfo Result - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

AD Service: How-To Set Field to GetMyInfo Result

Last post 04-18-2012 06:54 AM by ErnestoM. 21 replies.
Page 1 of 2 (22 items) 1 2 Next >
Sort Posts: Previous Next
  • 09-13-2005 01:32 PM

    AD Service: How-To Set Field to GetMyInfo Result

    PROBLEM:

    You have installed the AD Web Service and would like to set a value in your form to equal a value returned by the Web service, specifically, you'd like to pre-populate the user name or user info.

    SOLUTION:

    (In the InfoPath Designer )
    After you add a data connection for the GetMyInfo method of the AD Web Service and specify to retrieve data on load of the form... take the following steps to set the data:

    1. Double click on the field in the view that you want to set
    2. In the Default Value section, click on the fx button to the left.
    3. Click Insert Field or Group
    4. Select the Get My Info (Secondary) data source from the dropdown
    5. Expand dataFields->tns:GetMyInfoResponse->GetMyInfoResult->ADProp
    6. Select Value
    7. Click Filter Value
    8. Click Add
    9. Select Key in the first drop down
    10. Leave the second dropdown as "is equal to"
    11. In the third dropdown, type text "sAMAccountName" (or whatever key you want to set) without the double quotes. Notice that InfoPath adds double quotes after you type and tab out.
    12. Click OK 5 times to close the dialogs
    13. Preview your form

    Voila!


    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    InfoPath MVP
  • 10-02-2006 01:31 PM In reply to

    • scottr
    • Not Ranked
    • Joined on 09-26-2006
    • Posts 5

    Re: AD Service: How-To Set Field to GetMyInfo Result

    I don't want to set the default value on the field, but rather set the field value based on rules. I can't seem to get this to work though. Anyone have any ideas?
  • 10-02-2006 07:54 PM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Hi Scott and welcome to the forum,
    To set the value based on rules, create the rule to set a value in your form based on a value in the secondary data source. You can have the first action in your rule be to query the AD Web service to get the default user, or to get another user based on some information in the form. We do this all the time and it is pretty straight forward. Please describe your scenario in more detail and we can provide detailed steps to implement.
    Regards,
    Patrick Halstead
    InfoPath MVP
  • 10-03-2006 05:46 AM In reply to

    • scottr
    • Not Ranked
    • Joined on 09-26-2006
    • Posts 5

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Some more playing around and found that rules work, but I can seem to get it to fire when opening a form. If I put the rule on a button and press the button once the form is open, the rule fires just fine. If I put the rule under "Form Options"..."Open and save" it wont fire. If I put the rule on a text box and open the form it still doesn't fire. The only way I can seem to get the rule to fire, is via a button once the form is opened.

    Also, a little side question. How do I get a particular value (AD value) using code? I can't seem to get the syntax right.
  • 10-03-2006 02:54 PM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    There's an open rule. Go to Tools->Form Options->Advanced.
    Patrick Halstead
    InfoPath MVP
  • 11-20-2006 02:19 PM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Patrick,

    Similar to the side question that scottr had...how can I assign the username(GetUserInfo) field using jscript? I want to have one field that collects the username, assigns the username to the GetUserInfo username field and then queries AD. I can't seem to get it to work using jscript. Is it possible?

    Thanks for any assistance!
  • 11-20-2006 05:24 PM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Hi again,

    For the rule issue,
    Scott, sorry but I think I didn't respond to your first issue. Not sure why open rules don't work, but the data connection has a setting that determines whether it is called on load of the form. I think it's the last page of the wizard.

    For the code sample,
    We will post a HowTo on how to add an open rule do this in the next day or so. Thanks for your patience!
    Patrick Halstead
    InfoPath MVP
  • 04-20-2007 07:24 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Patrick,

    Do you have the code sample since I can not seem to find it?

    Christopher Sorel
    IT Manager
    csorel@imra.com
  • 04-20-2007 08:51 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    The Active Directory Web Service is included with our Database Accelerator Product.  Not sure if you have tried DBXL, but it really makes deploying and utilizing your InfoPath forms across the enterprise much easier and gives you as an admin much more ocntrol and security.

    The AD Service is pretty slick too.

     Here is the link. http://www.qdabra.com/proddetail.asp?prod=QDBXL1

    Please contact me if you have any questions.

  • 04-20-2007 10:41 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Clay thanks but not ready to implement that much yet.  Just looking to use your AD Service better than I am right now.  The user has to type in their managers email address to get the forms to go and this should be filled in for them.

     

    Chris

    Christopher Sorel
    IT Manager
    csorel@imra.com
  • 04-20-2007 10:43 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    So you already have it.

    I will check on the status of the documentation for the AD Service.

  • 04-20-2007 10:49 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Yes I have it.  I am playing around with GetUserInfo but still need to type something it and hit the button.  Should be able to use GetUserInfo some way in code to get the mangers email address.
    Christopher Sorel
    IT Manager
    csorel@imra.com
  • 10-24-2008 08:56 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Patrick

    I realize your post is old, but very relavant to me. I have an issue where I am designing a form that will be published on our SharePoint site. The form is currently set to bring in upon page load, my name (FirstName), my email (WorkEmail) address and my (Manager) in the form of DOMAIN\username. I accomplished this using a data connection called GetUserProfileByUsername which is calling the SharePoint webservice with the same name. What I need is to bring in my managers email address into a hidden field in the form upon form load. The form would be filled out and upon submit, the form would be emailed to the appropriate supervisors email.

    Any hints or help would be greatly appreciated.

    Kyle

  • 10-24-2008 09:07 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Hi Kyle, you'd have to call GetUserInfo using the manager's alias as the input parameter. When the form opens and calls GetManagerAlias, the next action (perhaps thru rules) that executes is using that manager's alias to call GetUserInfo. Do you think that would work?

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 10-24-2008 09:07 AM In reply to

    Re: AD Service: How-To Set Field to GetMyInfo Result

    Kyle

    I had this trouble at first.  I have Windows 2003 server with sharepoint services v3 with a Infopath 2007 form.  I thought I needed the email address and actually you do not.  Outlook handled the porcess with just Manager name in a field.  Then in the submitting of the form I put the manager field in the to.  Then once approved the form then goes onto the next person.

     Chris

    Christopher Sorel
    IT Manager
    csorel@imra.com
Page 1 of 2 (22 items) 1 2 Next >
Copyright © 2003-2012 Qdabra Software. All rights reserved.
View our Terms of Use.