Infopath - InfoPath Dev Sign in | Join | Help in General InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » General » Infopath Infopath Last post 11-04-2008 02:38 AM by Hari Krishna. 3 replies. Page 1 of 1 (4 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 11-03-2008 07:04 AM Kajal Patel Joined on 10-30-2008 UK Posts 15 Infopath Reply Contact I just need an Auto number created in my InfoPath form which then can be submitted into SQL. I do not have any repeating table.Can someone help me? 11-04-2008 02:03 AM In reply to Hari Krishna Joined on 08-30-2007 Posts 28 Re: Infopath Mark as Not AnswerMark as Answer... Reply Contact Hi, You can generate an auto number by using this code: thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1") = Guid.NewGuid().ToString(); Here field1 is the field in which autonumber is stored. 11-04-2008 02:15 AM In reply to Kajal Patel Joined on 10-30-2008 UK Posts 15 Re: Infopath Mark as Not AnswerMark as Answer... Reply Contact Many thanks for your reply. But where do I type this code. Sorry I am not sure. I am new to Infopath. 11-04-2008 02:38 AM In reply to Hari Krishna Joined on 08-30-2007 Posts 28 Re: Infopath Mark as Not AnswerMark as Answer... Reply Contact Hi, Paste this code in fields on after change event to the field which you want to generate autonumber. public void field1_OnAfterChange(DataDOMEvent e) {if (e.IsUndoRedo | isNull) {return; }if (e.Site.text == "") {isNull = true; thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1") = Guid.NewGuid().ToString();isNull = false; } } Do remember to declare isNull variable: private bool isNull = false; Page 1 of 1 (4 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Hi,
You can generate an auto number by using this code:
thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1") = Guid.NewGuid().ToString();
Here field1 is the field in which autonumber is stored.
Many thanks for your reply.
But where do I type this code.
Sorry I am not sure. I am new to Infopath.
Paste this code in fields on after change event to the field which you want to generate autonumber.
{
}
thisXDocument.DOM.selectSingleNode(
Do remember to declare isNull variable:
private