UserName function - InfoPath Dev
in

InfoPath Dev

UserName function

Last post 12-05-2008 10:22 AM by jrudolph. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-17-2008 12:28 PM

    • clawrence
    • Top 500 Contributor
    • Joined on 11-07-2008
    • Birmingham, AL
    • Posts 38

    UserName function

    I'm working on a browser-based form that has an expression box.  The expression box is shows the username.

    After submitting the form, I want somebody else to be able to open it up and edit it - however, when they do this, they username changes.

     How can I carry over the original username?

    Thanks for any help!

  • 11-17-2008 08:01 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Hi, 

    I think you are using username() function in username field default value.  Instead of this one set the username field value in onload. To set the field value in onload, follow these steps.


    1. Go to Tools->Form Options.
    2. Select Open and Save category in Form Options window.
    3. Click on Rules button.
    4. Click on Add->Add Action.
    5. In Action window select Set a fields value.
    6. Select username field.
    7. For value use username() function.
    8. Click Ok until all the windows gets closed.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 11-17-2008 09:03 PM In reply to

     

    Hi,

    In the above steps which was given by Anuma, put a condition while setting the user name that if user name is blank then set the user name field with the username() function. If you don't put this condition, every time the user name field is displayed with the user name who opened the form.

    Swathip
    www.ggktech.com
  • 11-21-2008 05:00 AM In reply to

    Clawrence

    You wrote you are using Expression box, expression box isn't saving the information, it just executes.

    When you want to keep the original username, you need to add a textbox, set the textbox to readonly and as defaultvalue you add username function

    Frederik Van Lierde

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
  • 11-21-2008 06:28 AM In reply to

    • clawrence
    • Top 500 Contributor
    • Joined on 11-07-2008
    • Birmingham, AL
    • Posts 38

    Perfect, thanks!

  • 12-05-2008 10:22 AM In reply to

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

    Wouldnt it be easier to uncheck the box for "Update this value when the result of the formula is recalculated." under the Default Value where userName() is the default value.

    This method would allow for the user creating the new forms name to be displayed only. Any subsequent users name would not be autofilled.

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