Submit button to save

J

Jewel

We added code to the submit button so that when it was clicked on the first
time, it submits to the foms library that it was opened from (there's also
other codes to do other things to the form). After that, a workflow moves
that form to another forms library. We need to add code so that when it's
clicked the second time, it saves to the form library. We tried to use:

this.Application.XmlForms[0].Save();

but it doesn't work. It gives us the following error message:

System.NotImplementedException: The method or operation is not implemented.
at
Microsoft.Office.InfoPath.Server.SolutionLifetime.ApplicationHost.get_XmlForms()
at Yellow_Form_Template.FormCode.SubmitFormToLibrary() at
Yellow_Form_Template.FormCode.FormEvents_Submit(Object sender,
SubmitEventArgs e)

Anyone have any ideas on how we can do that?
 
D

David Dean

Unfortunately, the Save() function is not supported in browser-enabled form
templates.

The best workaround is to add another Submit data connection to your form
template that saves the document to the second form library. You then change
the Submit Options to "Perform custom action using Rules", then add rules
that will conditionally execute one or the other of the Submit adapters,
depending on the value of a status field stored within your form. This status
field can be set by a rule, or by your workflow if you promote the field to
the document library and mark the field to allow its value to be changed
within SharePoint.

If you're already using program code in the form template, you can use the
"Perform custom action using Code" option and execute the correct
DataConnection from the Submit event handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top