Calcuations have stopped working suddenly - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Calcuations have stopped working suddenly

Last post 08-25-2012 10:01 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-24-2012 11:02 AM

    Calcuations have stopped working suddenly

    I've been working on an new for and I've run into a snag. Here's the link to the file if you want to take a look. http://www.msha.com/teds/help_template.xsn

    I have a field (ChkBxValid) at the bottom a view (Edit Items) which is critical to other functions in my form. This field is supposed to total the values of the check boxes in a table called Project Type which is also in the Edit Items view. For some reason it only displays NaN in the field instead of a number. The strange thing is, it was working and suddenly stopped. All I did was add some rules to a different view (ProjectDetails) that hide/unhide tables based on which check boxes were selected on the previous page. Yes, I went back through and retried adding and removing all of the rules on the second view to find the one that caused the problem but nothing worked. I even deleted the entire view!

     I've been working on this for two days now and cannot get it resolved so I'm just about ready to pull my hair out - and I don't have that much to begin with! Help please!

  • 08-24-2012 12:19 PM In reply to

    Re: Calcuations have stopped working suddenly

    Not sure what would have caused the change, but it looks like all of the fields used for the checkboxes in that section are starting off with the value false instead of 0, and that's what's causing the NaN.  It's possible to fix this by changing them all back in the Default Values dialog (on the Data tab), but with the possibility that this might happen again, you can make your formula more fault tolerant, like this:

     sum((firstField | secondField | thirdField | ... | lastField)[. > 0])

    Jimmy Rishe / Software Developer / InfoPath MVP
    Qdabra Software
  • 08-24-2012 11:10 PM In reply to

    Re: Calcuations have stopped working suddenly

    Jimmy:
    but it looks like all of the fields used for the checkboxes in that section are starting off with the value false instead of 0, and that's what's causing the NaN.  It's possible to fix this by changing them all back in the Default Values dialog (on the Data tab),
     

    This will help only until the first publishing or opening the template from sharepoint upon which Default 1 is reset to "TRUE" and 0 to "FALSE"

    I would have changed the default of checkboxes to blank with "Treat blank values as zeros" in Form Options>Advanced. This prevents them from auto-resetting and errors in calculation

    Though, what are the operands for creating boolean expressions. I tried "&" and "AND", they give errors

     

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 08-25-2012 10:01 AM In reply to

    Re: Calcuations have stopped working suddenly

    Gennady Vanin (Геннадий Ванин, Новосибирск):

    Though, what are the operands for creating boolean expressions. I tried "&" and "AND", they give errors

    It would be or and and (all lowercase).

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