web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Hyperlink via SMTP email

(0) ShareShare
ReportReport
Posted on by 231

Hello everyone.

Using Dynamics Business Central 365 online..

I have created an extension that does the following.

When a field is checked on the PO header, I generate a simple email that has the PO number and some text, using SMPT. send method.

That works great.I also want to add a hyperlink to this email similar to the Blue hyperlink below. When I click that it takes me to the Purchase invoice . It opens up a web browser with that document.

How can i get that done ? Looked at the hyperlink property but having no luck.

pastedimage1596048761167v1.png

  • Suggested answer
    JAngle Profile Picture
    159 on at

    Basing my answer on existing functionality. Report 1320 is the email users are sent when being notified about approvals for instance. That report has a web url for the document it relates to. It is a codeunit called page management that does all the heavy lifting here you just have to pass in some data.

    procedure GetWebUrl(var RecRef: RecordRef; PageID: Integer): Text

       begin

           if not RecRef.HasFilter then

               RecRef.SetRecFilter;

           if not VerifyPageID(RecRef.Number, PageID) then

               PageID := GetPageID(RecRef);

           exit(GetUrl(CLIENTTYPE::Web, CompanyName, OBJECTTYPE::Page, PageID, RecRef, false));

       end;

  • Verified answer
    Binesh Profile Picture
    7,887 on at

    Hello,

    You can do it by using the GETURL function by passing the record and page as shown below

    //Here URL is a text Variable.

     url := GETURL(CURRENTCLIENTTYPE(), COMPANYNAME()ObjectType::Page51, Rec);
     SMTPMail.AppendBody((StrSubstNo('<a href="%1">Open Purchase Invoice</a>', url)));

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 715 Super User 2026 Season 2

#2
AndrewThomas81 Profile Picture

AndrewThomas81 390 Super User 2026 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 386 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans