Continuing from previous post, further in next step we will apply same feature discussed in earlier post to our custom documents and learn where all places we need to take care development to get it working.
If you have missed First Part you can find here. Mail Sending Option in NAV 2017 with Cover Letter & Attachments –Part 1
In my Example I am using Policy Module:
I am using my Custom Table Policy where Policy Holder is setup as Customer, also few general details related to policy is stored. In nutshell we are concentration on Sending mail to customer as we have done in previous post for sending Invoice details to customer.
In my Policy Table I have added 2 Function as below:
IF DocumentSendingProfile.LookupProfile(“Policy Holder No.”,FALSE) THEN
SendProfile(VAR DocumentSendingProfile : Record “Document Sending Profile”)
DummyReportSelections.Usage::”Policy Issue”,Rec,”Document No.”,”Policy Holder No.”,
DocTxt,FIELDNO(“Policy Holder No.”),FIELDNO(“Document No.”));
In Table 77 Report Selections add new option to usage field
In Table 60 Document Sending Profile add below customization.
Add Text Constants
Update below function as:
In Table 9657 Custom Report Selection add below customizations.
In Page 9657 Custom Report Selection add below customization.
Create 2 Reports one for Mail Body and one for Attachment. You can use same report as attachment too, it depends on your requirement.
In Page Policy add below customization.
Setup your report Selection as below:
Now you are good to go.
Test your solution/ customization.
This is just a small idea, many lots can be done depending upon your requirements.