Custom Save - InfoPath Dev Sign in | Join | Help in Code 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 » Code » Custom Save Custom Save Last post 01-25-2011 12:44 PM by cooldude. 4 replies. Page 1 of 1 (5 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 01-21-2011 02:22 PM cooldude Joined on 01-20-2011 Posts 5 Custom Save Reply Contact Is it possible to have a "Save" button in the form and save the document exactly like how an Infopath save does i.e without checking the error validations etc etc...through code..if so can you share some examples Thanks, RK RK 01-21-2011 07:25 PM In reply to Potemkine Joined on 06-21-2010 Posts 451 Re: Custom Save Mark as Not AnswerMark as Answer... Reply Contact Hi you can use webclient to upload your form to SHarepoint: WebClient webclient = new WebClient(); webclient.Credentials = System.Net.CredentialCache.DefaultCredentials; webclient.UploadFile(remoteFileURL, "PUT", FilePath); webclient.Dispose(); 01-24-2011 09:20 AM In reply to cooldude Joined on 01-20-2011 Posts 5 Re: Custom Save Mark as Not AnswerMark as Answer... Reply Contact what do i need to give for remote file URL and File path...... RK 01-24-2011 06:26 PM In reply to Patrick Halstead Joined on 08-08-2006 Posts 5,112 Re: Custom Save Mark as Not AnswerMark as Answer... Reply Contact Hi CoolDude, qRules also supports clearing the error board so that you can do saves even though your form has validation errors. No code required either! :) Patrick HalsteadProject Manager at Qdabra 01-25-2011 12:44 PM In reply to cooldude Joined on 01-20-2011 Posts 5 Re: Custom Save Mark as Not AnswerMark as Answer... Reply Contact Iam able to solve the issue using code....I used the following code XPathNavigator xnMyForm = this.CreateNavigator(); SPList currentList = currentWeb.Lists[lstName]; using (SPWeb currentWeb = SPContext.Current.Site.OpenWeb()) { SPFile saveFile = null; currentList.ParentWeb.AllowUnsafeUpdates = true; saveFile = currentList.RootFolder.Files.Add(strFileName, Encoding.Default.GetBytes(xnMyForm.OuterXml)); currentList.ParentWeb.AllowUnsafeUpdates = false; currentWeb.Dispose(); } append ".xml" to strFileName so that form library recognizes the format to display it as an infopath form in the list items RK Page 1 of 1 (5 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Hi CoolDude,
qRules also supports clearing the error board so that you can do saves even though your form has validation errors. No code required either! :)