How to programically display a section as part of form submission (FormEvents_Submit) - InfoPath Dev Sign in | Join | Help in Newbie Questions 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 » Newbie Questions » How to programically display a section as part of form submission (FormEvents_Submit) How to programically display a section as part of form submission (FormEvents_Submit) Last post 08-02-2011 09:10 AM by Hilary Stoupa. 3 replies. Page 1 of 1 (4 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 07-29-2011 07:58 PM Derek Megyesi Joined on 07-07-2011 Calgary Posts 14 How to programically display a section as part of form submission (FormEvents_Submit) Reply Contact Greetings, I am using InfoPath 2007 and have created a form that has a section that I want hidden until the user clicks the "Submit" button, upon which I want the following to occur as part of form submission: 1) The 'hidden" section to be displayed 2) This "updated" form is emailed to the user (* haven't coded this 2nd part yet *) I have learned that I need to imbed this code in the "FormEvents_Submit" area of my code (I am using C#). So far this is what I have:public void FormEvents_Submit(object sender, SubmitEventArgs e) { // Get a reference to the main data sourceXPathNavigator trackingSection = MainDataSource.CreateNavigator().SelectSingleNode("/my:NLD_Training_Request_Form/my:TelusEmployeeSectionOrNotMainSection/my:TelusIDorNotChoiceMainSection/my:TELUSIDorNotHeaderSection/my:TrackingNumberSection", NamespaceManager); CurrentView.SelectNodes(trackingSection,trackingSection, "CTRL9"); CurrentView.ExecuteAction(ActionType.XOptionalInsert, "group1_263"); } ------------- But I am getting the following error at run-time: Only XPathNavigators from a DataObject are allowed.Parameter name: startNode Any Ideas? Derek CAREER SUMMARYAccomplished, energetic Information Technology professional with over 14 years of experience developing and implementing test strategies, operational procedures, and quality methodologies to support development and release of business applications. A hands-on leader with a proven ability to direct and improve quality programs, reduce defects, and improve overall efficiency and productivity. Extensive Business Analysis and Project Management knowledge, coupled with the ability to train, lead, and motivate effective cross functional teams. * Waterfall, Agile (SCRUM) * Release Management* PeopleSoft* Telecommunications* Automation* Quality Centre/ALM* ITIL* Metrics/ScorecardsTECHNICAL SKILLS* Programming:- Visual Basic, C/C++, Java, Perl/CGI, Tcl/Tk, XML, RSS* Databases: - Oracle RDBMS, SQL, mSQL, MS Access* Operating Systems: - HP-UX, Solaris, Linux, Windows XP, Vista, 7, Mac OS X, Windows Mobile 2003, PocketPC Phone Edition, Symbian, Blackberry, PalmOS, J2ME mid-p devices* Protocols / Technologies: - HL7, iPTV, IMS, 3GPP, SIP, Diameter, TCP/IP, OSI, PPP, 802.11, UMTS, GPRS, EDGE, GSM, CDMA-1xRTT, EV-DO, WiFi, Bluetooth, IrDA, SONET/SDH, DWDM* Software Products: - PeopleSoft, Quick Test Pro, Quality Center/ALM, WinRunner, WebLogic, Sun ONE iPlanet, Visio, MS Project, SharePoint, HP Universal CMDB, HP Service Manager Filed under: submit, programmmatically 07-31-2011 10:39 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: How to programically display a section as part of form submission (FormEvents_Submit) Mark as Not AnswerMark as Answer... Reply Contact There's no need to use code to show a hidden section. Just create a field in your form called Submitted that you set to true when the form is submitted. Then conditionally hide the hidden section based on the value of the Submitted field. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 08-02-2011 08:58 AM In reply to Derek Megyesi Joined on 07-07-2011 Calgary Posts 14 Re: How to programically display a section as part of form submission (FormEvents_Submit) Mark as Not AnswerMark as Answer... Reply Contact Hi Jimmy., Thanks for responding. Can you provide more details on how to do this? I am still learning how to use InfoPath? How do I set the Submited field to "True" when the form is submitted? Cheers,Derek CAREER SUMMARYAccomplished, energetic Information Technology professional with over 14 years of experience developing and implementing test strategies, operational procedures, and quality methodologies to support development and release of business applications. A hands-on leader with a proven ability to direct and improve quality programs, reduce defects, and improve overall efficiency and productivity. Extensive Business Analysis and Project Management knowledge, coupled with the ability to train, lead, and motivate effective cross functional teams. * Waterfall, Agile (SCRUM) * Release Management* PeopleSoft* Telecommunications* Automation* Quality Centre/ALM* ITIL* Metrics/ScorecardsTECHNICAL SKILLS* Programming:- Visual Basic, C/C++, Java, Perl/CGI, Tcl/Tk, XML, RSS* Databases: - Oracle RDBMS, SQL, mSQL, MS Access* Operating Systems: - HP-UX, Solaris, Linux, Windows XP, Vista, 7, Mac OS X, Windows Mobile 2003, PocketPC Phone Edition, Symbian, Blackberry, PalmOS, J2ME mid-p devices* Protocols / Technologies: - HL7, iPTV, IMS, 3GPP, SIP, Diameter, TCP/IP, OSI, PPP, 802.11, UMTS, GPRS, EDGE, GSM, CDMA-1xRTT, EV-DO, WiFi, Bluetooth, IrDA, SONET/SDH, DWDM* Software Products: - PeopleSoft, Quick Test Pro, Quality Center/ALM, WinRunner, WebLogic, Sun ONE iPlanet, Visio, MS Project, SharePoint, HP Universal CMDB, HP Service Manager 08-02-2011 09:10 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: How to programically display a section as part of form submission (FormEvents_Submit) Mark as Not AnswerMark as Answer... Reply Contact Submit using rules - then in your rules, you can use an action rule to set the field's value. Hilary Stoupa Page 1 of 1 (4 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Greetings,
I am using InfoPath 2007 and have created a form that has a section that I want hidden until the user clicks the "Submit" button, upon which I want the following to occur as part of form submission:
1) The 'hidden" section to be displayed
2) This "updated" form is emailed to the user (* haven't coded this 2nd part yet *)
I have learned that I need to imbed this code in the "FormEvents_Submit" area of my code (I am using C#). So far this is what I have:
{
CurrentView.SelectNodes(trackingSection,trackingSection,
CurrentView.ExecuteAction(ActionType.XOptionalInsert, "group1_263");
}
-------------
But I am getting the following error at run-time:
Only XPathNavigators from a DataObject are allowed.Parameter name: startNode
Any Ideas?
Derek
There's no need to use code to show a hidden section. Just create a field in your form called Submitted that you set to true when the form is submitted. Then conditionally hide the hidden section based on the value of the Submitted field.
Hi Jimmy.,
Thanks for responding. Can you provide more details on how to do this? I am still learning how to use InfoPath? How do I set the Submited field to "True" when the form is submitted?
Cheers,Derek
Submit using rules - then in your rules, you can use an action rule to set the field's value.