How to pre-populate user id - InfoPath Dev
in

InfoPath Dev

How to pre-populate user id

Last post 05-13-2007 11:09 PM by liorlankril. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 04-22-2006 03:30 AM

    • gaurs
    • Not Ranked
    • Joined on 04-04-2006
    • India
    • Posts 12

    How to pre-populate user id

    I need to pre-populate the user id when he open the form. How can I do this without code?
  • 04-22-2006 09:01 AM In reply to

    Re: How to pre-populate user id

    Not sure if you can do this within the form without code. Here is a thread to get you started:
    http://www.mcse.ms/archive180-2005-7-1727393.html
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 04-22-2006 03:06 PM In reply to

    Re: How to pre-populate user id

    Hi Gaurs,
    We created the Active Directory Web service (see Downloads) to solve you problem. You have to install it on a server on you network , but it will allow you to prepopulate the username without writing any code. You can get the user's logged-in alias if you use code, but there is no way to get the actual user's name without calling Active Directory (which is what our Web service does). It's only ~$20 and it is one of our most popular downloads. If you have any questions, please see the Premium Downloads forum where there are several good posts on how to use the Web service. It also comes with instructions on how to setup and use.

    Cheers!
    Patrick Halstead
    Project Manager at Qdabra
  • 04-22-2006 04:01 PM In reply to

    Re: How to pre-populate user id

    Oh, yeah, I forgot The Active Directory Web service on our website. It is the first option mentioned by Philip in his suggestions (see above link) and I quote "1. Get the InfoPath form to query Active Directory so that it can extract the user's name based on the account name you get from Environment.UserName." As Patrick said in his reply, it will allow you to prepopulate the username without writing any code. :-)
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 04-23-2006 09:13 PM In reply to

    • gaurs
    • Not Ranked
    • Joined on 04-04-2006
    • India
    • Posts 12

    Re: How to pre-populate user id

    I just need the userid. Through the code, Can I use Environment.UserName or Context.User.Identity.Name?
  • 04-23-2006 09:42 PM In reply to

    Re: How to pre-populate user id

    In C# and VB.net is Environment.UserName.
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 05-22-2006 08:38 AM In reply to

    • Chloe
    • Not Ranked
    • Joined on 05-22-2006
    • Posts 1

    Re: How to pre-populate user id

    I'm doing the same thing, using C# code to populate a text box with the user id. I get the user id when I preview the form, but when I publish the form to a Shrepoint form library it doesn't populate the user id. I don't get any security warnings or errors, and I'm not sure what I need to do to get it to work.
  • 05-22-2006 02:17 PM In reply to

    Re: How to pre-populate user id

    This is actually a limitation when working with managed code.

    Try this: make a button in the form that calls this code:

    thisXDocument.UI.Alert( Environment.UserName );

    and you will be able to see the error that InfoPath emits. We have talked about this and have not found a workaround.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-13-2007 11:09 PM In reply to

    Re: How to pre-populate user id

     

    What should I write instand of Enviermanr.UserName if my form's code is simplae vbscript (no c# or VB.NET)????

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