Hi experts
I have code unit from NAV 2016 which custom code unit .I used CAL to AL converter To get AL file .but now it showing all errors as many functionality,table ,CU related to mail depreciated from NAV to BC. I am not getting how to move forward Any help will Really appreciated Thanks in Advance!
I have shared code unit Which Converted in AL
codeunit 50001 "Send Mail" { trigger OnRun() begin end; var SMTPMail: Codeunit "400"; SMTPSetup: Record "409"; procedure SendMailToCust(CustNo: Code[20]) var Customer: Record 18; CustLedgEntry: Record 21; SalesPerson: Record 13; begin SMTPSetup.GET; Customer.GET(CustNo); Customer.TESTFIELD("E-Mail"); SMTPMail.CreateMessage(SMTPSetup."Email Sendor Name", SMTPSetup."Email Sendor Email", Customer."E-Mail", 'Pending Payments', '', TRUE); SalesPerson.GET(Customer."Salesperson Code"); IF SalesPerson."E-Mail" <> '' THEN SMTPMail.AddCC(SalesPerson."E-Mail"); SMTPMail.AppendBody('Dear Sir / Madam,'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('Please find Pending Payments List.'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('
Invoice No. | '); SMTPMail.AppendBody('Invoice Date | '); SMTPMail.AppendBody('Due Date | '); SMTPMail.AppendBody('Invoice Amount | '); SMTPMail.AppendBody('Balance Amount | '); SMTPMail.AppendBody('
---|---|---|---|---|
' FORMAT(CustLedgEntry."Document No.") ' | '); SMTPMail.AppendBody('' FORMAT(CustLedgEntry."Posting Date") ' | '); SMTPMail.AppendBody('' FORMAT(CustLedgEntry."Due Date") ' | '); SMTPMail.AppendBody('' FORMAT(CustLedgEntry."Amount (LCY)") ' | '); SMTPMail.AppendBody('' FORMAT(CustLedgEntry."Remaining Amt. (LCY)") ' | '); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('Regards,'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('Admin'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('This is a system generated mail. Please do not reply to this email ID.'); SMTPMail.Send; end; procedure SendTestMailtoCust(CNo: Code[20]) var Cust: Record Customer; begin Cust.GET(CNo); SMTPSetup.GET; SMTPMail.CreateMessage(SMTPSetup."Email Sendor Name", SMTPSetup."Email Sendor Email", Cust."E-Mail", 'Test Mail', 'This the the mail Body', TRUE); SMTPMail.Send; end; procedure SendMailToCustWithAttachment(CustNo: Code[20]) var Customer: Record Customer; CustLedgEntry: Record 21; SalesPerson: Record 13; // StatementINPDF: Codeunit "50000"; begin SMTPSetup.GET; Customer.GET(CustNo); Customer.TESTFIELD("E-Mail"); SMTPMail.CreateMessage(SMTPSetup."Email Sendor Name", SMTPSetup."Email Sendor Email", Customer."E-Mail", 'Sales Statistics', '', TRUE); SalesPerson.GET(Customer."Salesperson Code"); IF SalesPerson."E-Mail" <> '' THEN SMTPMail.AddCC(SalesPerson."E-Mail"); SMTPMail.AppendBody('Dear Sir / Madam,'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('Please find Attached Sales Statistics.'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('Regards,'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('Admin'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('
'); SMTPMail.AppendBody('This is a system generated mail. Please do not reply to this email ID.'); SMTPMail.AddAttachment(SMTPSetup."Path to Save Report", ''); SMTPMail.Send; end; } [View:/cfs-file/__key/communityserver-discussions-components-files/758/SendMail.Codeunit.al:320:240