mibuso.com

Microsoft Business Solutions online community
It is currently Thu May 23, 2013 2:23 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Error in Mail sending from 397
PostPosted: Fri Mar 30, 2012 1:30 pm 
Offline

Joined: Thu Mar 22, 2012 1:37 pm
Posts: 10
Location: Delhi
Country: India (in)
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


Top
 Profile E-mail  
 
 Post subject: Re: Error in Mail sending from 397
PostPosted: Fri Mar 30, 2012 1:34 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4226
Location: New Delhi
Country: India (in)
Did you try to assign this statement to a boolean?

like Result := Mail.Send();

Send function might be returning boolean..please check CU397 send functionn

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Error in Mail sending from 397
PostPosted: Fri Mar 30, 2012 1:56 pm 
Offline

Joined: Thu Mar 22, 2012 1:37 pm
Posts: 10
Location: Delhi
Country: India (in)
After ur suggesion i have corrected it. But again i am getting same error.

---------------------------
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')

_________________
Regards
Pradeep Bhardwaj


Top
 Profile E-mail  
 
 Post subject: Re: Error in Mail sending from 397
PostPosted: Fri Mar 30, 2012 11:58 pm 
Offline

Joined: Sat Jan 28, 2012 4:48 pm
Posts: 56
Country: Netherlands (nl)
I am not sure why this function "Send" is available in cu 397. The function "NewMessage" already comprises this line of code:
Code: Select all
MailSent := OSendMail.Send;


You could try to omit your line "Mail.Send();"


Top
 Profile  
 
 Post subject: Re: Error in Mail sending from 397
PostPosted: Sat Mar 31, 2012 11:48 am 
Offline
Site Admin
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Sun Nov 07, 1999 8:01 am
Posts: 3293
Location: Wilrijk
Country: Belgium (be)
Enable the debugger so you can see which line causes the error.

_________________
No support using PM or e-mail - Please use this forum.
Search is your friend || Mark your Topic as SOLVED (= green checkmark) when your question is answered || Read the Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2013 - 7 & 8 November 2013 ««« Visit the conference website: www.navtechdays.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: