Is there a way to detect AD username upon form launch? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Is there a way to detect AD username upon form launch?

Last post 06-14-2011 11:24 PM by Patrick Halstead. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-05-2011 06:22 AM

    Is there a way to detect AD username upon form launch?

    Hi,

     Is there a way to detect AD username upon form launch? Something like when you submit the form using DBXL, DBXL is able to detect which user submitted the form. However, instead of a post event, is there a field on the form that stores this data?

    Understand that you can use GetMyInfo to get Value[Key = "displayName"]. However, it seems to work only for the first user who launch the form. I need this "GetMyInfo" to detect a form updater's displayName and use it for some conditional formating rules. Therefore, this GetMyInfo will need to be updated everytime the form is launched. I have checked update this value when formula is recalculated but it does not seem to update it.

     Thanks for any help,

    Zhen Yuan

  • 06-06-2011 01:17 AM In reply to

    • GedCT
    • Top 200 Contributor
      Male
    • Joined on 01-27-2010
    • Chesterfield & Leeds, UK
    • Posts 52

    Re: Is there a way to detect AD username upon form launch?

    Hi,

    I use the GetMyInfo procedure to record the identify of the person opening the form, not just as a post processing task.  I set the receiving data connection to point to the DBXL web service and to access HTTP://server:port/QdabraWebService/ADUserInfo.asmx?WSDL.  I then have a text field in the form called FormAuthor and I set the default value of this field to Value[key="cn"] to get the name of the individual.  If I subsequently attach this to a text box on the front page, it then displays the name of the person that opens the form, different each time.

    I've attached a screenshot to demonstrate.

    Screen shot

    Ged

    Ged Connolly-Thompson
    Senior Business Systems Analyst

    Leeds Musculoskeletal Biomedical Research Unit
    Leeds Institute of Rheumatic and Musculoskeletal Medicine

    Director
    2and7 Limited
  • 06-06-2011 06:27 PM In reply to

    Re: Is there a way to detect AD username upon form launch?

    Hi Ged,

     I have tried that method but it does not work for me. The field only populates with the initial form author, subsequent updates on the form does not change the field values. I've checked the box, "Update this value when the results of the formula is recalculated". Am I supposed to check that box?

     

    Thanks,

    ZhenYuan

  • 06-14-2011 10:52 AM In reply to

    Re: Is there a way to detect AD username upon form launch?

    Hi ZhenYuan,

    If you want to reset the field when the form opens (i.e. subsequent updates), just add a Form Load rule that sets the value to the Active Directory info.

    Hope that helps!

    Patrick Halstead
    Project Manager at Qdabra
  • 06-14-2011 06:25 PM In reply to

    Re: Is there a way to detect AD username upon form launch?

    Hi Patrick,

     Do you mean set the rule to update the field value with the GetMyInfo data connection? Hmmm, shouldn't this be done when we check the box "Update this value when the results of the formula is recalculated". This check doesn't seem to do the recalculation.

    Now that I reread the statement, I'm wondering what it means when the results of the formula is recalculated. How will this be triggered? When the input parameters are updated? Or when the output result is updated/different?

     

    Thanks,

    Zhen Yuan

  • 06-14-2011 11:24 PM In reply to

    Re: Is there a way to detect AD username upon form launch?

    There's a difference between rules and default values. Default values don't work to automatically recalculate when they are based on secondary data sources that don't change. So, you should just use a rule if you want to update it every time someone else opens the form.

    It's triggered on form load. You could add a rule to a button or a field and trigger it in a different way. Lots of options.

    Best!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.