The expression is not a node-set - need help with a condition in default value of a textbox - InfoPath Dev
in

InfoPath Dev

The expression is not a node-set - need help with a condition in default value of a textbox

Last post 01-02-2015 02:53 PM by Doreen. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-02-2015 12:38 PM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    The expression is not a node-set - need help with a condition in default value of a textbox

    I am following this tutorial to include a condition in a default value of a textbox:  http://blogs.msdn.com/b/infopath/archive/2006/11/27/conditional-default-values.aspx

    In a nutshell [if a date is greater than 12/31/14, default value shall be (textbox1A / textbox2A), else (textbox1 / textbox2)], translated to actual field names in my form then my default value for  AverageScore3  is entered as such:

    (SumRatings3 / NumChecked3 | SumRatings3A / NumChecked3A) [(DueDate > dateCompare) + 1]

    translates to xpath:

    (./my:Safety_3/my:group3/my:SumRatings3A / ./my:Safety_3/my:group3/my:NumChecked3A | ./my:Safety_3/my:group3/my:SumRatings3 / ./my:Safety_3/my:group3/my:NumChecked3)[( ./my:EmployeeHeaderSection/my:DueDate > ./my:Debug/my:dateCompare) + 1]

    Yet I am receiving this error message with my expression in the default value field:

    The expression is not a node-set.
    -->(./my:Safety_3/my:group3/my:SumRatings3A div ./my:Safety_3/my:group3/my:NumChecked3A | ./my:Safety_3/my:group3/my:SumRatings3 div ./my:Safety_3/my:group3/my:NumChecked3)<--[( ./my:EmployeeHeaderSection/my:DueDate > ./my:Debug/my:dateCompare) + 1]

    I cannot use code behind to accomplish this because the form uses qRules and DBXL.  I also cannot use Rules because I am modifying a form that needs the formula to remain intact for existing forms.  The approach I am taking then is to have a default value with a condition so the old formula works for existing forms, and the new formula works with new forms. Maybe there's a better way?

    The Copy XPath for the fields in the formula is:

    DueDate = /my:myFields/my:EmployeeHeaderSection/my:DueDate

    dateCompare = /my:myFields/my:Debug/my:dateCompare

    AverageScore3 = /my:myFields/my:Safety_3/my:AverageScore3

    NumChecked3 = /my:myFields/my:Safety_3/my:group3/my:NumChecked3

    SumRatings3 = /my:myFields/my:Safety_3/my:group3/my:SumRatings3

    NumChecked3A = /my:myFields/my:Safety_3/my:group3/my:NumChecked3A

    SumRatings3A = /my:myFields/my:Safety_3/my:group3/my:SumRatings3A

    Question: the first part of my expression is not a node set, but which node?

     

  • 01-02-2015 02:53 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: The expression is not a node-set - need help with a condition in default value of a textbox

    Never mind.  I found another way to approach this.  I am setting the value when submit button is clicked.  It's not as pretty, but it works.
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.