Answered by:
Using Conditions in InfoPath - How do I avoid getting NaN

Question
-
Hi guys, I follow this article “Auto-numbering InfoPath forms when they are submitted to a SharePoint form library” to create an auto-numbering form. The tutorial is great but if the library is empty I received a “NaN”. They provide a solution but I don’t know how to implement it. This is:
Add a Button to the form with the following 4 rules:
1. Query the RetrieveIDs data connection
2. Set the autonumber field equal to 1 when count(@ID) = 0
3. Set the autonumber field equal to max(@ID) + 1 when count(@ID) > 0
4. Submit the form to the form library
How can I create rule 2 and 3?
Full article here!!
- Edited by Mike Walsh FIN Wednesday, May 20, 2009 5:36 PM !! removed. No need for it.
Wednesday, May 20, 2009 3:41 PM
Answers
-
As promised, here it is:
Auto-Numbering InfoPath Forms (my version)
SharePoint Architect || http://claytoncobb.wordpress.com- Proposed as answer by RobCrocker Thursday, May 27, 2010 5:35 PM
- Marked as answer by Mike Walsh FIN Friday, June 11, 2010 4:08 AM
- Marked as answer by Mike Walsh FIN Friday, June 11, 2010 11:32 AM
Monday, June 15, 2009 10:44 PM
All replies
-
Just do what it says. In your button, make a rule after rule 1 that sets the autonumberfield = 1 upon the condition that count(@ID) = 0. Do the same for step 3.
The rules are self-explanatory. Just go through the rule and condition wizard to make these steps.
SharePoint Architect - Planet Technologies - 4-Year Microsoft Federal Partner of the Year (2005-2008)Wednesday, May 20, 2009 4:07 PM -
in the article http://www.bizsupportonline.net/blog/2008/03/infopath-qa-how-do-i-avoid-getting-nan-when-using-the-max-function/
the first step is- Change the RetrieveIDs data connection to use the autonumber field instead of max(@ID) + 1.
is this autonumber field on the infopath form?
Confused on all the steps. any advice would be really helpfull.
Thanks.Monday, June 15, 2009 2:36 PM -
in the article http://www.bizsupportonline.net/blog/2008/03/infopath-qa-how-do-i-avoid-getting-nan-when-using-the-max-function/
I have this resolved and will do a full write-up in place of that link, but for now, I will just try to get you the screenshots of the rule/condition settings.
SharePoint Architect || http://claytoncobb.wordpress.com- Edited by Mike Walsh FIN Friday, June 11, 2010 4:08 AM Don't use full quote-
Monday, June 15, 2009 4:17 PM -
As promised, here it is:
Auto-Numbering InfoPath Forms (my version)
SharePoint Architect || http://claytoncobb.wordpress.com- Proposed as answer by RobCrocker Thursday, May 27, 2010 5:35 PM
- Marked as answer by Mike Walsh FIN Friday, June 11, 2010 4:08 AM
- Marked as answer by Mike Walsh FIN Friday, June 11, 2010 11:32 AM
Monday, June 15, 2009 10:44 PM -
Thanks a millions. that works perfectly.Friday, June 19, 2009 2:13 PM
-
Hi guys!!!
I need to store the number generated to continue after the last one, because when I close the form the ID start from begin (0) again!
When I close the form I need that it starts from the last number generated.
Someone to help me???
Thursday, October 15, 2009 5:51 PM -
Wesley, you act like you can just ask the question without giving details and someone is going to magically know the answer. You already know how to do this, because you've already seen my blog in-depth. The only reason it's not working for you is because you did it wrong. You've seen my blog, you know it works, so you know you just have to find and fix your error. Asking this question on a forum without any details doesn't make much sense.
Hopefully, the mods can finally mark my answer above for this one. Sameel didn't feel fit to do so despite all the time I spent to give him that write-up.
SharePoint Architect || My BlogFriday, October 16, 2009 1:45 AM -
As promised, here it is:
Can someone please post the resolution to this question? Unfortunately, the above site is blocked by websense at work so I couldn't get the answer myself. Thank you.I followed the steps found @ http://www.bizsupportonline.net/blog/2008/03/infopath-qa-how-do-i-avoid-getting-nan-when-using-the-max-function/. But, I'm still getting a NaN value for the first submitted form. I'm using Infopath 2003.
Any help is appreciated. Thank you.
- Edited by Mike Walsh FIN Friday, June 11, 2010 4:09 AM Don't use full quote.
Thursday, June 10, 2010 8:01 PM -
> Unfortunately, the above site is blocked by websense at work so I couldn't get the answer myself.
So access it at home.
The full text of articles should not be posted in a forum. What should be here is *a brief description* followed by a URL.
2010 Books: SPF 2010; SPS 2010; SPD 2010; InfoPath 2010; Workflow etc.
2007 Books: WSS 3.0; MOSS 2007; SPD 2007; InfoPath 2007; PerformancePoint; SSRS; Workflow
Both lists also include books in French; German; Spanish with even more languages in the 2007 list.Friday, June 11, 2010 4:10 AM -
I don't understand why you say add a button ...
can't this be done with Form load rules?
Wednesday, November 10, 2010 7:00 PM -
Clayton, Is there anything that needs to be done differently from the steps in your blog when dealing with Infopath 2010? I have been trying to follow the steps as closely as I can, but am still getting a NaN error in the field when trying to submit.
Tuesday, May 28, 2013 12:37 PM