Custom Save - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Custom Save

Last post 01-25-2011 12:44 PM by cooldude. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-21-2011 02:22 PM

    Custom Save

    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

    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

    what do i need to give for remote file URL and File path......
    RK
  • 01-24-2011 06:26 PM In reply to

    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 Halstead
    Project Manager at Qdabra
  • 01-25-2011 12:44 PM In reply to

    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.