emailing after save
Etienne Jacquet
Hello,I have a quick question, I search in Core Suite Designer and the Forum but I didn't found the info so, here is my question. There is an option to print after save. Using it, is it possible to email by clicking add button in a document?
Thanks for your help.
Etienne
Philipp Knecht
Hi EtienneIt is possible but needs some Scripting.
The best solution would be to use coresuite customize and register a script to this event which starts cld.
But there is another solution which will work but renders each document twice:
In the GenerateScript:
If Not Engine.IsDoublePass Then
If GetData("LD.Par.AfterSave") = "Y" Then
Engine.CancelRender()
LayoutHelper.LayoutOpener.ExecutePrintDef("MyPrintDefCodeT0000065", LayoutHelper.LayoutOpener.OpenLayoutModes.Email,"DocEntry", GetData("LD.Par.DocEntry"))
End If
End If
This cancels the real Print After Save and reissues the command in mail context, thus rendering everything twice.
hth
Etienne Jacquet
Thanks a lot Philipp!I'll check which on of this to option we will use. We will get closer to this customize tool to see what we can do with it.
Etienne
Etienne Jacquet
Hi!I'm still on the email sending topic. Using the script, it is working well and know I can manage to send a email only if the email is present in business partner data.
But, how can I inser the contact email in the field "to" of the email. I can get the mail with a query using the doc entry and the getdata function however, this function is not accepted in the Email/Fax tab of the print definition (as I already saw in an other topic of this forum). So, is it possible to update this field in the layout or, how can I manage it?
Thanks!!
Etienne
Philipp Knecht
Hi EtienneIn this field you can put either:
- a valid Query (Test it with query Analyzer)
- or a sequence of Placeholders be it [%MyParam] for Parameters or [@T0000010] for Multilanguage Texts.
So you need to make a valid Query in this case.
hth
Etienne Jacquet
Hi Philipp!It works perfectly, thanks!
0
Please sign in to leave a comment.
Comments
0 comments