Hello Forum
I have the following piece of code used to alter the main submit data connection. This code captures two fields and concatenates them onto the existing submit data connection in order to submit this to the correct folder.
This works in the InfoPath client, but when publish to SP, we receive an error stating that the submit event handler returned a value indicating that the submit failed. I have tried publishing the form both under Domain and Full Trust and still get the same issue.
Any thoughts?? Thanks
XPathNavigator xnLocation = xnDoc.SelectSingleNode("my:myFields/my:DocLibrary", this.NamespaceManager);
XPathNavigator xnClient = xnDoc.SelectSingleNode("my:myFields/my:Client", this.NamespaceManager);
XPathNavigator xnCampaign = xnDoc.SelectSingleNode("my:myFields/my:CampaignSelection", this.NamespaceManager);
FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections["Main Submit"];
fc.FolderUrl = xnLocation.Value + "/" + xnClient.Value + "/" + xnCampaign;
try
{
fc.Execute();
e.CancelableArgs.Cancel = false;
}
catch (Exception ex)
{
e.CancelableArgs.Cancel = true;
}