Order Details are not coming in E-Mail notification of order approval

While sending the approval request, e-mail notification is sent to Approver ID with showing Microsoft Dynamics NAV Document Approval System.

How can I get the order details in e-mail notifications?

which CU are you using to send mails?

440-Approvals Mgt Notification

I didnt work on Approval Mgt notification e-mails…

But if i go through the codeunit, it is inserting the order details in template and not in mail subject or body…

If you need them you have to customize…

How is it possible to capture the same in mail body which is inserting in template.

It is possible as we have Orderheader as parameter in function…

Try and let us know what did you try…

Now it’s coming like Microsoft Dynamics NAV Document Approval System\Purchase Order:12BLR020003

How can I show the order details in new line? I have removed the below code from the CU. Will it affect any process?

WHILE InStreamTemplate.EOS() = FALSE DO BEGIN
InStreamTemplate.READTEXT(InSReadChar,1);
IF InSReadChar = ‘%’ THEN BEGIN
SMTP.AppendBody(Body);
Body := InSReadChar;
IF InStreamTemplate.READTEXT(InSReadChar,1) <> 0 THEN;
IF (InSReadChar >= ‘0’) AND (InSReadChar <= ‘9’) THEN BEGIN
Body := Body + ‘1’;
CharNo := InSReadChar;
WHILE (InSReadChar >= ‘0’) AND (InSReadChar <= ‘9’) DO BEGIN
IF InStreamTemplate.READTEXT(InSReadChar,1) <> 0 THEN;
IF (InSReadChar >= ‘0’) AND (InSReadChar <= ‘9’) THEN
CharNo := CharNo + InSReadChar;
END;
END ELSE
Body := Body + InSReadChar;
FillPurchaseTemplate(Body,CharNo,PurchaseHeader,ApprovalEntry,0);
SMTP.AppendBody(Body);
Body := InSReadChar;
END ELSE BEGIN
Body := Body + InSReadChar;
I := I + 1;
IF I = 500 THEN BEGIN
SMTP.AppendBody(Body);
Body := ‘’;
I := 0;
END;
END;
END;

Can you show your code how you did that?

IS that message in Subject or body?

That message is in body only. My code is :

Body := Text013+’’+STRSUBSTNO(Text002,PurchaseHeader.“Document Type”)+’:’+PurchaseHeader.“No.”

LF := 10;

Body := Text013+FORMAT(LF)+STRSUBSTNO(Text002,PurchaseHeader.“Document Type”)+’:’+PurchaseHeader.“No.”;

Where LF is variable of type Char

Now its showing in the same line only like this Microsoft Dynamics NAV Document Approval System Purchase Order:12BLR020001

I want to show like:

Microsoft Dynamics NAV Document Approval System

Purchase Order:12BLR020001

I tried in new report as I cannot use Codeunit 440 Directly

LF := 10;
Body := Text013 + FORMAT(LF) + STRSUBSTNO(Text002,‘Order’)+’:’+‘106024’;
Message(’%1’,Body);

Copied Text013 and Text002 from codeunit 440

If mail is send using HTML, then CR/LF do not work.

If you want it to work, you have to modify

SMTP.CreateMessage(SenderName,SenderAddress,Recipient,Subject,Body,TRUE);

to

SMTP.CreateMessage(SenderName,SenderAddress,Recipient,Subject,Body,FALSE);

in Codeunit 440

Ok, so instead of actually figuring out how this works, your solution was to delete code and add your own? This is the kind of thing that drives me crazy.

Under Approval Setup, there is a Mail Template button where you import / export the HTML document that will be used as the template. You can export the one from the Cronus database as an example.

In Codeunit 440 there are two functions, FillSalesTemplate and FillPurchaseTemplate. These show you how the fields are mapped in the template. These functions create the body of the email.

You could have done this entire thing without modifying a single line of code. It’s all in the system documentation (Application Setup, Chapter 7). [:’(]

Thank you very much Mr. Matt. Now its working fine…