I am working with Navision 9 SP1.
Targeted work:- Auto PDF Generation and Mail the generated PDF file.
--> PDF is generating Successfully.
--> But when i trying to mail this PDF. Its shows the following error.
Microsoft Dynamics NAV Classic
Boolean must not be blank.
Boolean is missing or invalid in the expression.
OK
Note :- In this code i am using Code unit 397..
Cust.RESET;
Cust.SETRANGE("No.","Sell-to Customer No.");
IF Cust.FIND('-') THEN BEGIN
Cust.TESTFIELD(Cust."E-Mail");
IF Cust."E-Mail" <> '' THEN BEGIN
EmailBody[1]:='Dear '+"Bill-to Contact"+',';
EmailBody[2]:='I am sending the Sales Quote. Please find the attachment.';
EmailBody[3] := 'With Regards,';
EmailBody[4] := 'Satyam Tayal';
Lf[1] := 13;
Lf[2] := 10;
Mail.AddBodyline(EmailBody[1]);
Mail.AddBodyline(Lf);
Mail.AddBodyline(EmailBody[2]);
Mail.AddBodyline(Lf);
Mail.AddBodyline(Lf);
Mail.AddBodyline(Lf);
Mail.AddBodyline(Lf);
Mail.AddBodyline(EmailBody[3]);
Mail.AddBodyline(Lf);
Mail.AddBodyline(EmailBody[4]);
Mail.NewMessage(Cust."E-Mail",'','Quotation Report','','C:\PDF\'+"No."+'.PDF',TRUE);
Mail.Send();
//MESSAGE('%1',Test);
END;
END ELSE
MESSAGE('File not found')
will any body suggest me what i have to do????
If someone suggest me to use codeunit 400 instead of 397.
Please specify me reason for this.
Thanks in advance.
Pradeep Kumar
Regards
Pradeep Bhardwaj
0
Comments
like Result := Mail.Send();
Send function might be returning boolean..please check CU397 send functionn
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Microsoft Dynamics NAV Classic
Boolean must not be blank.
Boolean is missing or invalid in the expression.
OK
Mail.AddBodyline(Lf);
Mail.AddBodyline(EmailBody[3]);
Mail.AddBodyline(Lf);
Mail.AddBodyline(EmailBody[4]);
Mail.NewMessage(Cust."E-Mail",'','Quotation Report','','C:\PDF\'+"No."+'.PDF',TRUE);
:-# Test:=Mail.Send();
//MESSAGE('%1',Test);
END;
END ELSE
MESSAGE('File not found')
Pradeep Bhardwaj
You could try to omit your line "Mail.Send();"