Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
While running codeunit its sending all customer statement as pdf .not only specific customer.
if i use setrange filter 1img error come.
with filter sending email with all customer report not specific.
See the below code for your reference, this code is working for me.
SendCSMail is a function with simple code which will send email for each customer.
if you are using Report 116 then use filter as per your report, I have used Report 10072.
CustomerStatement.InitializeRequest is a custom function to initialize the request page of the report.
WITH CustomerG DO BEGIN
SETFILTER("No.", '3|100|100182|100676'); Customer number filters
SETRANGE(Blocked, Blocked::" ");
NewPrintEntriesDue := TRUE;
NewPrintAllHavingBal := TRUE;
NewPrintCompany := TRUE;
NewPrintRemitTo := TRUE;
NewUpdateNumbers := TRUE;
NewStatementStyle := NewStatementStyle::"Open Item";
NewAgingMethod := NewAgingMethod::"Trans Date";
NewStartDate := CALCDATE('-CM',TODAY);
IF FINDSET THEN BEGIN
CLEAR(CustomerStatement); //Report 10072
NewChosenOutputMethod, NewPrintRemaining, NewStartDate
AttachmentFileWithPath := Path + CustomerL."No." + '.pdf'; //Attachment File Name
IF CustomerStatement.SAVEASPDF(AttachmentFileWithPath) THEN BEGIN
IF FileManagement.ServerFileExists(AttachmentFileWithPath) THEN BEGIN
IF NOT RemoveEmptyFile(AttachmentFileWithPath) THEN
SendCSMail(AttachmentFileWithPath, ToAddressL, CS_Subject);
UNTIL NEXT = 0;
i use this code for send company logo in email but its send blank image plzhelp
You are exporting the Image to FileName and in the email Attachment you have used FilePath variable that's why you are not getting the attachment.
***I recommended you to sending email with attachment use the stream attachment.
I have used the stream as shown below and it works, Stream will increase the performance because you do not required additional tasks
like inserting in temp blob and exporting again.
LOCAL SendMailWithAttachment() //function name
WITH CU400 DO BEGIN
T409."User ID", //Sender Address
T409."Test Mail ID", //Recipients Address
STRSUBSTNO(Sub, TODAY), //Subject
AppendBody(STRSUBSTNO('Please ignore the email as it was testing by %1.', USERID));
AppendBody('This is a system generated mail. Please do not reply to this mail id');
IF CompanyInformation.Picture.HASVALUE THEN BEGIN
Business Applications communities