Bonjour,
J'ai un problème avec la fonctionnalité d'affichage conditionel et l'envoi d'un formulaire InfoPath. (mode web forms)
Je m'explique, pour faire simple j'ai recréé le problème simplement.
J'ai un formulaire infopath avec un champ date 'DT'
2 data connections pour envoyer le formulaire
- MainSubmit : envoi du formulaire dans une librairie sharepoint.
- EmailTheForm : envoi du forumaire par mail.
Le forumulaire est configuré de manière à être envoyé via code behind :
Jusque là tout fonctionne bien.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 public void FormEvents_Submit(object sender, SubmitEventArgs e) { FileSubmitConnection submitConnection = (FileSubmitConnection)this.DataConnections["MainSubmit"]; submitConnection.Execute(); EmailSubmitConnection emailConncetion = (EmailSubmitConnection)this.DataConnections["EmailTheForm"]; emailConncetion.Execute(); // If the submit operation is successful, set e.CancelableArgs.Cancel = false; }
J'ajoute maintenant une section et j'utilise l'affichage conditionel,
avec une simple condition TD > adddays(today();3) pour masquer cette section si la date est supérieur à aujourd'hui + 3 jours.
Rien de compliqué donc et pourtant là c'est le drame au moment du submit par mail lors de l'appel à la méthode emailConncetion.Execute();
Quelqu'un aurait-t-il une idée ? Cela fait une semaine que je cherche désespérement comme un fou, et mon client commence à se poser des questionsExtension object 'http://schemas.microsoft.com/office/infopath/2003/xslt/Date' does not contain a matching 'adddays' method that has 2 parameter(s).
System.Xml.Xsl.XslTransformException: Extension object 'http://schemas.microsoft.com/office/infopath/2003/xslt/Date' does not contain a matching 'adddays' method that has 2 parameter(s).
at System.Xml.Xsl.Runtime.XmlExtensionFunction.Bind()
at System.Xml.Xsl.Runtime.XmlExtensionFunctionTable.Bind(String name, String namespaceUri, Int32 numArgs, Type objectType, BindingFlags flags)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
at <xsl:template match="my:VIPSection" mode="_2">(XmlQueryRuntime {urn:schemas-microsoft-comslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-comslt-debug}current)
at <xsl:template match="my:myFields">(XmlQueryRuntime {urn:schemas-microsoft-comslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-comslt-debug}current)
at <xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-comslt-debug}runtime, XPathNavigator )
at Root(XmlQueryRuntime {urn:schemas-microsoft-comslt-debug}runtime)
at Execute(XmlQueryRuntime {urn:schemas-microsoft-comslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
at Microsoft.Office.InfoPath.Server.Util.XslTransform.Transform(IXPathNavigable input, XsltArgumentList argumentList, TextWriter output)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterEmail.GetViewHtml(XmlDocument input, String viewName, XsltContext xsltContext, Solution solution, Boolean cleanUpFormatting, String intro, String introSubmittedBy, ImageAttachmentHelper imageAttachmentHelper)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterEmail.Execute(XPathNavigator input, String to, String cc, String bcc, String subject, String intro, String attachmentFileName, String viewName, Boolean sendAsInfoMail, EmailAttachmentType emailAttachmentType, XsltContext xsltContext, String xsnUrl)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterEmail.ExecuteInternal(XPathNavigator input)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterEmail.Execute()
at Microsoft.Office.InfoPath.Server.DocumentLifetime.EmailSubmitConnectionHost.<Execute>b__0()
at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.ExecuteOMCallWithExceptions(OMCall d, ExceptionFilter exceptionFilter)
An entry has been added to the Windows event log of the server.
Log ID:5337
--------------------------------------------------------------------------------
An error occurred while the form was being submitted.
The submit event handler returned a value indicating that the submit failed.
Merci.
Partager