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

Community site session details

Session Id :

How to Create a Hyperlink in a Mail to Open a Page in Business Central/NAV

Syed Mehdi Profile Picture Syed Mehdi 5

Hello Readers,

I am Writing this blog because of one of the Queries I came across where the User wants to have a hyperlink while receiving a Notification Email from Business Central/NAV. When clicking on that hyperlink, the Page from Windows Client opens up directly from the Email.

To achieve this, we have to insert the text in the Mail Body in HTML Format containing the hyperlink.

For that, you have to create a link of the Page like the one I have created below.

hyperlinkText := '<a href=' + GETURL(CURRENTCLIENTTYPE,COMPANYNAME) + 'runpage?page=50000&personalization=50000&mode=View' + '>' + 'Click this link to open Page</a>';

Body := hyperlinkText;
SMTP.AppendBody(Body);

In the above example, I have taken an example of opening Page 50000 by mentioning it in the link. GETURL funtion will return a link of the current Client which is executing the code with the Company Name somewhat like the below link:

dynamicsnav://smehdi.archer.local:7046/bc140/CRONUS%20Canada%2C%20Inc./

After creating the hyperlink text, you have to Append it to the Body using the AppendBody function of the SMTP Mail Codeunit.

I hope this Blog will help all the Developers out there while creating the Custom Mail Notifications. Please comment below if you have any questing regarding this blog or any topic suggestions for my next Blog.

Thanks for Reading!


This was originally posted here.

Comments

*This post is locked for comments