Username() returns nothing for non-AD Users - InfoPath Dev
in

InfoPath Dev

Username() returns nothing for non-AD Users

Last post 12-05-2008 09:25 AM by jrudolph. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-05-2008 07:40 AM

    Username() returns nothing for non-AD Users

    I am building a browser based form in InfoPath 2007 hosted on MOSS.  Our SharePoint implementation has two sides to it the Internal side, and the external customer facing side where our clients can log in and upload docs and colaborate and such.  The problem I am having is in the form I have a section with requestor information.  Currently it is a drop down fed by a contacts list in SharePoint.  Which then autofills Phone and Email.  What I want to do is use the Username() function to set a default for the Reequestor name.  The problem is this works fine for AD users and when you are logged in your information fills in, but our external users who are logging into sharepoint with a sharepoint username not a windows username.  The field I set just shows up blank.

    In trouble shooting I just added a username field and set the default value to username() this appeared with my user name when I was logged in but was blank when external users log in.

    This isn't a deal breaker for the forms functionality, the only issueis we hope to have upwards of 90 users accessing this form and the dropdown would be a little hard to manage.

     

    Any suggestions or explanations would be much appreciated.

    ~*"Logic is the cement of our civilization, with which we ascend from chaos, using reason as our guide" - T'Plana-Hath, Matron of Vulcan Philosophy *~
  • 12-05-2008 08:22 AM In reply to

    • jrudolph
    • Top 150 Contributor
      Male
    • Joined on 07-02-2008
    • Orlando, FL
    • Posts 67

    Re: Username() returns nothing for non-AD Users

    You may want to use this method instead of the Username() method.

    http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

    We had the same issue, but once I used the above method our problems were fixed. As long as the user have been registered in your Web Services on your server this method should work easily.

  • 12-05-2008 09:09 AM In reply to

    Re: Username() returns nothing for non-AD Users

    Thanks,

    Although this info did not solve my problem it pointed me to the cause.  All our external users don't have any meta data associated with their logins.  I still don't get entirly why I can't pull the user name but there is like no data associated with the users in sharepoint.

    ~*"Logic is the cement of our civilization, with which we ascend from chaos, using reason as our guide" - T'Plana-Hath, Matron of Vulcan Philosophy *~
  • 12-05-2008 09:25 AM In reply to

    • jrudolph
    • Top 150 Contributor
      Male
    • Joined on 07-02-2008
    • Orlando, FL
    • Posts 67

    Re: Username() returns nothing for non-AD Users

    Yes that would be a problem.

    Unless I am mistaken the Username() function is pulling the name associated with the user loged in to the machine being used to fill out the form, so another thing you should take into account is that it would be entirely possible for User 1 to be using User 2's computer filling out the form online and this would cause User 2 to auto fill in the form causing discrepancies with using the Username() function.

    If it wouldnt be hard for you to implement I would suggest using the web service and entering in all users meta data and setting it up so that if new people register or become clients, or whatever, part of the procedure for getting them started in SP would be to use that service.

    I hope this is helpful.

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