The requirement is while running Customer Statement Report (116) i want to send email as pdf customer who are all have the email id . if customer dnt have email automaticllly report should print normaly from printer.
for emailing part am ok.
how should i automate to print if customer dont have email id..?
Any idea on this requirement...?
thanks ,
Rathin
0
Comments
If you want more details on the Customer Statement distribution process, PM me and I have some further documentation.
If you decide to reinvent the wheel and just want to customize this, then the approach would basically be to create a processing report to loop through all customers. For each customer, call the statement report either using SAVEASPDF if they have an email address, or print it if they don't. You'll need to pass settings from the processing report (statement options) through to the actual statement report. Our product also includes copies of all open invoices with each statement to eliminate the customer calling to say they're missing invoice(s) and someone having to re-send them (time consuming).
http://www.epimatic.com
CLEAR(CustEmail);
CLEAR(CompanyEmail);
lCompInfo.GET();
CompanyEmail := lCompInfo."E-Mail";
lSalHead.RESET;
lSalHead.SETRANGE("Document Type",SalesHeader."Document Type");
lSalHead.SETRANGE("No.",SalesHeader."No.");
REPORT.SAVEASPDF(50002, 'E:\reports\default.pdf', lSalHead);
Cust.GET(SalesHeader."Sell-to Customer No.");
CustEmail := Cust."E-Mail";
IF RespCenter.GET(SalesHeader."Responsibility Center") THEN
lResCentermail := RespCenter."E-Mail";
IF lResCentermail <>'' THEN
lccMail := lResCentermail +';'+CompanyEmail
ELSE
lccMail := CompanyEmail;
IF CustEmail <>'' THEN BEGIN
CLEAR(DespatchInfo);
SalOrderAck := TRUE;
Mail.NewMessage(CustEmail,lccMail,STRSUBSTNO('Sale Order Acknowledgement %1',"No."),'',
"3Tier".DownloadTempFile('E:\reports\default.pdf'),FALSE);
END;
In Here Mail is variable indicates codeunit :
Note:SAVEASPDF function works only RDLC Report.
:thumbsup: