in rule, set value if not blank, not working? - InfoPath Dev
in

InfoPath Dev

in rule, set value if not blank, not working?

Last post 03-27-2009 05:36 AM by Jimmy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-26-2009 06:07 AM

    in rule, set value if not blank, not working?

    Hi,

    InfoPath 2007 client form.  I want to store the username of the user who first created the form.  I have a field called Originator, with no default value, and the following rule:

    If Originator is blank
        Set field value . = userName()

    But the field is always blank when I preview it!  Any ideas why this doesn't work and/or how I can acheive what I want?

    Thanks.

  • 03-26-2009 06:30 AM In reply to

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

    Re: in rule, set value if not blank, not working?

    Hi,

    I think you have added Rule to that field.

    But you need to add open rule to that form.

    go to below path and add rule. 

    Tools-->Formsoptions-->Open and save tab -->Rules

     For more idea verify attached xsn.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 03-27-2009 01:21 AM In reply to

    Re: in rule, set value if not blank, not working?

    Or you could specify userName() as the default value for the field.

    Fields' rules only execute when the value changes.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-27-2009 02:33 AM In reply to

    Re: in rule, set value if not blank, not working?

    Wouldn't the value then be overwritten if someone else opened the form?

  • 03-27-2009 05:36 AM In reply to

    Re: in rule, set value if not blank, not working?

    No, the default value only has an effect when the field is created (e.g. in a new form or when the field is part of a new row in a repeating section).

    If you uncheck "Update this value when the result of the formula is recalculated," it should be fine.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.