Email Function

I read this post Email with order details - #7 par Mykola but cannot get it to work right. I select the model which in my case is SaleOrder and start adding subject and content data into the template.

But whenever I select the BIRT template which is SaleOrder in the attached files field. Whenever I click on « Send Mail » it prompts file could not be generated

Caused by: com.axelor.apps.base.AxelorException: The file could not be generated.
        at com.axelor.apps.base.service.birt.template.BirtTemplateReportSettingsBuilder.build(BirtTemplateReportSettingsBuilder.java:123)
        at com.axelor.apps.base.service.birt.template.BirtTemplateServiceImpl.generateBirtTemplateFile(BirtTemplateServiceImpl.java:84)
        at com.axelor.apps.base.service.message.TemplateMessageServiceBaseImpl.createMetaFileUsingBirtTemplate(TemplateMessageServiceBaseImpl.java:97)
        at com.axelor.apps.base.service.message.TemplateMessageServiceBaseImpl.getMetaFiles(TemplateMessageServiceBaseImpl.java:73)

As soon as I remove SaleOrder Birt template from that Template. I can generate the « Send Email » just fine and can see the Subject and Content data I added previously.

Additionally, I do have a custom BIRT template but have also tried the default SaleOrder BIRT Template to no avail.

Any ideas on how I could attach my SaleOrder PDF into the send email function?

Hello

As per your error log, I can only say issue is in generating the PDF from BIRT report design. Issue may be of passing required parameters or parameter different type , etc.

Is it possible for you cross check the parameters once

Thank you

Hi there,

Here’s the entire output of the log that you asked for earlier.

2024-03-18 12:33:13.145 DEBUG 154712 --- [0.0-8008-exec-2] c.a.m.s.TemplateMessageServiceImpl       : Subject ::: Quote N°
2024-03-18 12:33:13.145 DEBUG 154712 --- [0.0-8008-exec-2] c.a.m.s.TemplateMessageServiceImpl       : Media ::: 2
2024-03-18 12:33:13.160 DEBUG 154712 --- [0.0-8008-exec-2] c.a.m.s.TemplateMessageServiceImpl       : Metafile to attach: []
2024-03-18 12:33:13.160 DEBUG 154712 --- [0.0-8008-exec-2] a.a.b.s.m.TemplateMessageServiceBaseImpl : Generate birt metafile: SaleOrder
2024-03-18 12:33:13.229 ERROR 154712 --- [0.0-8008-exec-2] com.axelor.utils.ExceptionTool           : The file could not be generated.
java.lang.IllegalStateException: The file could not be generated.
        at com.axelor.apps.base.service.message.TemplateMessageServiceBaseImpl.getMetaFiles(TemplateMessageServiceBaseImpl.java:76)
        at com.axelor.message.service.TemplateMessageServiceImpl.generateMessage(TemplateMessageServiceImpl.java:170)
        at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:64)
        at com.axelor.message.service.TemplateMessageServiceImpl.generateMessage(TemplateMessageServiceImpl.java:104)
        at com.axelor.message.service.GenerateMessageServiceImpl.generateMessage(GenerateMessageServiceImpl.java:34)
        at com.axelor.message.web.GenerateMessageController.callMessageWizard(GenerateMessageController.java:92)
        at jdk.internal.reflect.GeneratedMethodAccessor1284.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.axelor.meta.ActionHandler.call(ActionHandler.java:247)
        at com.axelor.meta.schema.actions.ActionMethod.evaluate(ActionMethod.java:77)
        at com.axelor.meta.schema.actions.Action.execute(Action.java:101)
        at com.axelor.meta.schema.actions.Action.wrap(Action.java:114)
        at com.axelor.meta.schema.actions.ActionGroup.evaluate(ActionGroup.java:236)
        at com.axelor.meta.schema.actions.Action.execute(Action.java:97)
        at com.axelor.meta.schema.actions.Action.wrap(Action.java:114)
        at com.axelor.meta.ActionHandler.execute(ActionHandler.java:516)
        at com.axelor.meta.ActionExecutor.execute(ActionExecutor.java:58)
        at com.axelor.rpc.ResponseInterceptor.invoke(ResponseInterceptor.java:61)
        at com.axelor.web.service.ActionService.execute(ActionService.java:79)
        at com.axelor.rpc.RequestFilter.invoke(RequestFilter.java:56)
        at com.axelor.rpc.ResponseInterceptor.invoke(ResponseInterceptor.java:70)
        at jdk.internal.reflect.GeneratedMethodAccessor501.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
        at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)
        at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
        at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:408)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:69)
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
        at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
        at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
        at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
        at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249)
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:60)
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
        at com.axelor.db.tenants.AbstractTenantFilter.doFilter(AbstractTenantFilter.java:71)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:44)
        at io.buji.pac4j.filter.SecurityFilter.lambda$doFilter$1(SecurityFilter.java:79)
        at org.pac4j.core.engine.DefaultSecurityLogic.perform(DefaultSecurityLogic.java:140)
        at com.axelor.auth.pac4j.AxelorSecurityLogic.perform(AxelorSecurityLogic.java:82)
        at io.buji.pac4j.filter.SecurityFilter.doFilter(SecurityFilter.java:77)
        at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:450)
        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.axelor.app.internal.AppFilter.doFilter(AppFilter.java:88)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:94)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.axelor.db.tenants.AbstractTenantFilter.doFilter(AbstractTenantFilter.java:71)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.axelor.web.servlet.CorsFilter.doFilter(CorsFilter.java:138)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.axelor.web.servlet.ProxyFilter.doFilter(ProxyFilter.java:44)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.axelor.apps.base.AxelorException: The file could not be generated.
        at com.axelor.apps.base.service.birt.template.BirtTemplateReportSettingsBuilder.build(BirtTemplateReportSettingsBuilder.java:123)
        at com.axelor.apps.base.service.birt.template.BirtTemplateServiceImpl.generateBirtTemplateFile(BirtTemplateServiceImpl.java:84)
        at com.axelor.apps.base.service.message.TemplateMessageServiceBaseImpl.createMetaFileUsingBirtTemplate(TemplateMessageServiceBaseImpl.java:97)
        at com.axelor.apps.base.service.message.TemplateMessageServiceBaseImpl.getMetaFiles(TemplateMessageServiceBaseImpl.java:73)
        ... 101 common frames omitted

I haven’t changed the default parameters on the BIRT template once. But I’ll leave the image of the parameters for the SaleOrder BIRT template below. Could it be that attach function under the BIRT Template file field? I’ve tried that and it made no difference. What’s the purpose of that? I don’t have any ideas on how to make this work

Hello

Can you make sure this ?

Thank you

Hey rch,

I went ahead and modified it to false. It’s working now just fine. You indicate on that post that you can pass that dynamically by keeping that value in context of Sale Order view. What exactly are you talking about? Does this happen for any other BIRT template or just specific to Sale Order? Thank you for the help.

Hello

This is about Sale Order BIRT report design. As you are using existing report , this is the solution.
It’s resolved in latest release versions.

And for keeping it dynamically from context, there are multiple ways, You can add dummy field on form and you can receive the value from user or you can assign some default value through actions , etc.

Thank you

Okay got it. Thank you for the help

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.