Email Submit form & conditional formatting not working together ? - InfoPath Dev
in

InfoPath Dev

Email Submit form & conditional formatting not working together ?

Last post 03-15-2010 08:54 AM by cetims. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-15-2010 08:54 AM

    • cetims
    • Not Ranked
    • Joined on 03-15-2010
    • Posts 2

    Email Submit form & conditional formatting not working together ?

    Hi there,

    Customer ask me to add something like a confirm message (visible or not dependind some conditions) in a browser forms using InfoPath Forms Services.

    My idea was simply to use an section with conditional formatting

     This form use code behind as submit options. 2 datas connections are using to submit to a sharepoint library and email

    and when i add a section with conditionnal formatting i receive an error on the submit event :

    on this EmailSubmitConnection.Execute();

    Extension 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-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
    at <xsl:template match="my:myFields">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
    at <xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator )
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-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.
     
     
     
     
    The submit event code :

    public void FormEvents_Submit(object sender, SubmitEventArgs e)
    {
    FileSubmitConnection submitConnection = (FileSubmitConnection)this.DataConnections["MainSubmit"];
    submitConnection.Execute(); //<= this working fine

    EmailSubmitConnection emailConncetion = (EmailSubmitConnection)this.DataConnections["EmailTheForm"];
    emailConncetion.Execute(); //<= this line cause the errors

    // If the submit operation is successful, set
    e.CancelableArgs.Cancel = false;
    }

    The conditional formatting on the section is simply a condition like "if the field TD is greater than today + 3 days then the section is not visible"

     TD > adddays(today();3) 

    I have try other conditions but same kind of error, cannot find the method ....

    This occurs only with web forms when submit is perform by code.

    I'm really desesperate with this issue, 1 week to search after a solution ....

     

     Please help.

    Thx in advance

    Cédric.

     

     

     

     

  • 03-15-2010 08:54 AM In reply to

    • cetims
    • Not Ranked
    • Joined on 03-15-2010
    • Posts 2

    Email Submit form & conditional formatting not working together ?

    Hi there,

    Customer ask me to add something like a confirm message (visible or not dependind some conditions) in a browser forms using InfoPath Forms Services.

    My idea was simply to use an section with conditional formatting

     This form use code behind as submit options. 2 datas connections are using to submit to a sharepoint library and email

    and when i add a section with conditionnal formatting i receive an error on the submit event :

    on call to this method EmailSubmitConnection.Execute();

    Extension 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-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
    at <xsl:template match="my:myFields">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
    at <xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator )
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-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.
     
     
     
     
    The submit event code :

    public void FormEvents_Submit(object sender, SubmitEventArgs e)
    {
    FileSubmitConnection submitConnection = (FileSubmitConnection)this.DataConnections["MainSubmit"];
    submitConnection.Execute(); //<= this working fine

    EmailSubmitConnection emailConncetion = (EmailSubmitConnection)this.DataConnections["EmailTheForm"];
    emailConncetion.Execute(); //<= this line cause the errors

    // If the submit operation is successful, set
    e.CancelableArgs.Cancel = false;
    }

    The conditional formatting on the section is simply a condition like "if the field TD is greater than today + 3 days then the section is not visible"

     TD > adddays(today();3) 

    I have try other conditions but same kind of error, cannot find the method ....

    This occurs only with web forms when submit is perform by code.

    I'm really desesperate with this issue, 1 week to search after a solution ....

     

     Please help.

    Thx in advance

    Cédric.

     

     

     

     

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.