No email address in outlook email opened via navision

Hello! Can anybody explain the following thing…

When I want to send an email via navision I open lets say an invoice, choose an option “send email”. Than outlook email opens with pdf file attached. But the address bar is empty! Though an email address is defined in contact card… What should I do to make email address appear in Outlook letter?

On the other computer in company everything works fine. Both pdf file and email address appear in letter.

Thanks in advance.

Welcome to DUG!!

You will not get outlook address with this option in outlook .

You need write customized code for this.

Thanks for quick answer! Everything works fine on the other computer (Windows XP) by default. In Windows 7 - no address.

Anyway… what this code is and where should I write it??? Sorry for such newbee questions [:D]

Is there any customization done for this?

Where is option lying ? Is it on Sales Invoice Card or are you using Standard Option i.e File Menu → Send by email

Here is screenshot. Its in Estonian. “Saada meiliga” = “send via email”

So it is customization

I don’t know from where program pick the email id as you are saying you have already set email id on contact card .I feel it is taking email address from Invoice card

You need to find out from which setup it is picking email id.

Just look at the code.

Can you please say where this code is?

Are you technical Developer ?

If yes then just debug the code by enabling debugger

Press SHIFT+CTRL+F11 and SHIFT+CTRL+F12 .This will activate the debugger

Now click on the Send Email Option .So it will take you to the code

OK! Here is the code. What should I change?

SendMail()
//PDF - New function
PurchaseHeader := Rec;
MailCU.PurchaseUnPostedFORMSendMail(PurchaseHeader,0);
Form - OnOpenForm()
IF UserMgt.GetPurchasesFilter() <> ‘’ THEN BEGIN
FILTERGROUP(2);
SETRANGE(“Responsibility Center”,UserMgt.GetPurchasesFilter());
FILTERGROUP(0);
END;
Form - OnFindRecord()
IF FIND (Which) THEN
EXIT(TRUE)
ELSE BEGIN
SETRANGE(“No.”);
EXIT(FIND(Which));
END;
Form - OnAfterGetRecord()
SETRANGE(“Document Type”);
Form - OnNewRecord()
“Responsibility Center” := UserMgt.GetPurchasesFilter();
Form - OnDeleteRecord()
CurrForm.SAVERECORD;
EXIT(ConfirmDeletion);
- OnAssistEdit()
IF AssistEdit(xRec) THEN
CurrForm.UPDATE;
- OnAfterValidate()
CurrForm.UPDATE;
- OnAfterValidate()
CurrForm.PurchLines.FORM.UpdateForm(TRUE);
- OnAfterValidate()
CurrForm.PurchLines.FORM.UpdateForm(TRUE);
- OnAfterValidate()
CurrForm.PurchLines.FORM.UpdateForm(TRUE);
- OnAfterValidate()
CurrForm.UPDATE;
- OnAfterValidate()
CurrForm.UPDATE;
- OnAfterValidate()
CurrForm.PurchLines.FORM.UpdateForm(TRUE);
- OnAssistEdit()
CLEAR(ChangeExchangeRate);
ChangeExchangeRate.SetParameter(“Currency Code”,“Currency Factor”,“Posting Date”);
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE(“Currency Factor”,ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
- OnAfterValidate()
CurrForm.UPDATE;
- OnPush()
PurchSetup.GET;
IF PurchSetup.“Calc. Inv. Discount” THEN BEGIN
CurrForm.PurchLines.FORM.CalcInvDisc;
COMMIT;
END;
FORM.RUNMODAL(FORM::“Purchase Order Statistics”,Rec);
- OnPush()
Rec.ShowDocDim;
- OnPush()
ApprovalEntries.Setfilters(DATABASE::“Purchase Header”,“Document Type”,“No.”);
ApprovalEntries.RUN;
- OnPush()
CurrForm.PurchLines.FORM.OpenSalesOrderForm;
- OnPush()
PurchHeader.COPY(Rec);
DistIntegration.GetSpecialOrders(PurchHeader);
Rec := PurchHeader;
- OnPush()
CurrForm.PurchLines.FORM.OpenSpecOrderSalesOrderForm;
- OnPush()
CurrForm.PurchLines.FORM.ApproveCalcInvDisc;
- OnPush()
CurrForm.PurchLines.FORM.ExplodeBOM;
- OnPush()
CurrForm.PurchLines.FORM.InsertExtendedText(TRUE);
- OnPush()
StdVendPurchCode.InsertPurchLines(Rec);
- OnPush()
CurrForm.PurchLines.FORM.ShowReservation;
- OnPush()
CurrForm.PurchLines.FORM.ShowTracking;
- OnPush()
CopyPurchDoc.SetPurchHeader(Rec);
CopyPurchDoc.RUNMODAL;
CLEAR(CopyPurchDoc);
- OnPush()
ArchiveManagement.ArchivePurchDocument(Rec);
CurrForm.UPDATE(FALSE);
- OnPush()
CLEAR(MoveNegPurchLines);
MoveNegPurchLines.SetPurchHeader(Rec);
MoveNegPurchLines.RUNMODAL;
MoveNegPurchLines.ShowDocument;
- OnPush()
GetSourceDocInbound.CreateFromPurchOrder(Rec);

IF NOT FIND(’=><’) THEN
INIT;
- OnPush()
CreateInvtPutAwayPick;

IF NOT FIND(’=><’) THEN
INIT;
- OnPush()
IF ApprovalMgt.SendPurchaseApprovalRequest(Rec) THEN;
- OnPush()
IF ApprovalMgt.CancelPurchaseApprovalRequest(Rec,TRUE,TRUE) THEN;
- OnPush()
IF ApprovalMgt.TestPurchasePrepayment(Rec) THEN
ERROR(STRSUBSTNO(Text001,“Document Type”,“No.”))
ELSE BEGIN
IF ApprovalMgt.TestPurchasePayment(Rec) THEN BEGIN
IF NOT CONFIRM(STRSUBSTNO(Text002,“Document Type”,“No.”)) THEN
EXIT;
Status := Status::“Ootel ettemaks”;
MODIFY;
CurrForm.UPDATE;
END ELSE
ReleasePurchDoc.PerformManualRelease(Rec);
END;
- OnPush()
ReleasePurchDoc.PerformManualReopen(Rec);
- OnPush()
//PDF
SendMail()
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN
BizTalkManagement.SendPurchaseOrder(Rec);
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN
ICInOutboxMgt.SendPurchDoc(Rec,FALSE);
- OnPush()
ReportPrint.PrintPurchHeader(Rec);
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN BEGIN
IF ApprovalMgt.TestPurchasePrepayment(Rec) THEN
ERROR(STRSUBSTNO(Text001,“Document Type”,“No.”))
ELSE BEGIN
IF ApprovalMgt.TestPurchasePayment(Rec) THEN BEGIN
IF NOT CONFIRM(STRSUBSTNO(Text002,“Document Type”,“No.”),TRUE) THEN
EXIT
ELSE
CODEUNIT.RUN(CODEUNIT::“Purch.-Post (Yes/No)”,Rec);
END ELSE
CODEUNIT.RUN(CODEUNIT::“Purch.-Post (Yes/No)”,Rec);
END;
END;
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN BEGIN
IF ApprovalMgt.TestPurchasePrepayment(Rec) THEN
ERROR(STRSUBSTNO(Text001,“Document Type”,“No.”))
ELSE BEGIN
IF ApprovalMgt.TestPurchasePayment(Rec) THEN BEGIN
IF NOT CONFIRM(STRSUBSTNO(Text002,“Document Type”,“No.”),TRUE) THEN
EXIT
ELSE
CODEUNIT.RUN(CODEUNIT::“Purch.-Post + Print”,Rec);
END ELSE
CODEUNIT.RUN(CODEUNIT::“Purch.-Post + Print”,Rec);
END;
END;
- OnPush()
REPORT.RUNMODAL(REPORT::“Batch Post Purchase Orders”,TRUE,TRUE,Rec);
CurrForm.UPDATE(FALSE);
- OnPush()
ReportPrint.PrintPurchHeaderPrepmt(Rec);
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN
PurchPostYNPrepmt.PostPrepmtInvoiceYN(Rec,FALSE);
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN
PurchPostYNPrepmt.PostPrepmtInvoiceYN(Rec,TRUE);
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN
PurchPostYNPrepmt.PostPrepmtCrMemoYN(Rec,FALSE);
- OnPush()
IF ApprovalMgt.PrePostApprovalCheck(SalesHeader,Rec) THEN
PurchPostYNPrepmt.PostPrepmtCrMemoYN(Rec,TRUE);
- OnPush()
DocPrint.PrintPurchHeader(Rec);
- OnPush()
CurrForm.PurchLines.FORM.ItemAvailability(0);
- OnPush()
CurrForm.PurchLines.FORM.ItemAvailability(1);
- OnPush()
CurrForm.PurchLines.FORM.ItemAvailability(2);
- OnPush()
CurrForm.PurchLines.FORM.ShowReservationEntries;
- OnPush()
CurrForm.PurchLines.FORM.OpenItemTrackingLines;
- OnPush()
CurrForm.PurchLines.FORM.ShowDimensions;
- OnPush()
CurrForm.PurchLines.FORM.ItemChargeAssgnt;

You have check in this

MailCU.PurchaseUnPostedFORMSendMail

Where MailCu is defined as Codeunit Variable

Go to that codeunit and check function PurchaseUnPostedFORMSendMail

Ok, here is that function:

//PDF - New function
WITH “Purchase Header” DO BEGIN
GetSalesSetup;
IF ReportID = 0 THEN
CASE “Document Type” OF
“Document Type”::Pakkumine: ReportID := FindStandardReport(ReportSelection.Usage::“O.pakkumine”);
“Document Type”::Tellimus: ReportID := FindStandardReport(ReportSelection.Usage::“O.tellimus”);
“Document Type”::Arve,“Document Type”::Kreeditarve:
ReportID := FindStandardReport(ReportSelection.Usage::“O.test”);
END;
EXIT(SendPurchaseDocument(“Purchase Header”,“Purch. Inv. Header”,“Purch. Cr. Memo Hdr.”,“Return Shipment Header”,
“Purch. Rcpt. Header”,RepDocType::UnPosted,ReportID,FALSE,TRUE));
END;

What should I change and how? It seems debugger only lets to view things but not to edit them.

Not able to understand .

I feel kindly contact your technical consultant for the same.