Validating a user from Active Directory using an secondary dataconnection and userName() function - InfoPath Dev
in

InfoPath Dev

Validating a user from Active Directory using an secondary dataconnection and userName() function

Last post 12-21-2009 01:16 AM by markj8e. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-15-2009 06:11 AM

    Validating a user from Active Directory using an secondary dataconnection and userName() function

    Hi all

    I am creating a load of new forms for out IT dept. We haven't got a sharepoint server but i am exporting active directory user details using a program called Hyena.

    I am exporting the data into Access then Exporting from Access to an XML data file.

     

    This is all working great and i have also used this guide...

    http://www.infopathdev.com/blogs/matt/archive/2006/04/18/Automatically-Populate-Fields-from-a-Drop_2D00_Down-Selection.aspx

     

    ...to auto populate the user details in the form using a single drop down box.


    This creates a problem though for form validation on which a user could select any name and fill out the form and submit it.

     

    What i wanted to do is hide the drop down list box from users and using the get username function built into Infopath 2007 validate the user.

    So in other words how can i get the drop downlist box to automatically select the right user based on another field which is looking up the logged on user using the userName() function??? This will then inturn populate all user credentials from the secondary data source at an onload event or button press.

    Thanks in advance

    Mark

  • 12-17-2009 08:02 PM In reply to

    Re: Validating a user from Active Directory using an secondary dataconnection and userName() function

    First off, if you don't want users to select anything, then don't use a dropdown - the whole purpose of a dropdown box is to make a choice.  If you just want this field to be auto-set and not selected, then change it to a text box, make it read-only, and set its default value to the value userName().  Did you try that?  If you have exact usernames in the DB, then it should match up automatically, and then your rules on that field can trigger to set the other fields automatically.  Seems simple unless I'm missing something.

    BTW, instead of your roundabout method for getting AD info, you could use the Qdabra ADWS tool to get the info directly and easily at a very low cost.

  • 12-18-2009 01:38 AM In reply to

    Re: Validating a user from Active Directory using an secondary dataconnection and userName() function

    I wish it was that simple. How do i get the text box to look up the XML data connection then? I tried changing the drop down to a text box but it strips out the data connection and filtering and everything.

    Agreed the whole purpose of a drop down is for users to make a choice but they may get the idea's of the forms wrong and choose the wrong user in the wrong place. (I don't have much faith in our users)

    If there is another way to auto populate fields from an XML source by only using text boxes please show me how.

    Thanks

  • 12-18-2009 08:29 AM In reply to

    Re: Validating a user from Active Directory using an secondary dataconnection and userName() function

    Have you tried placing a rule on your userName field that queries the secondary data source and then uses the results of the query?

    You might also want to consider using a Form Load rule instead, since the value of userName() should be available from the time the form opens.  Like Clay, I'm having trouble understanding how a dropdown box would help this situation at all.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-21-2009 01:16 AM In reply to

    Re: Validating a user from Active Directory using an secondary dataconnection and userName() function

    How can i do that then so it queries the secondary data source? I can see you can add a query but how do does it lookup the data source data?

    Thanks

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