Technical Articles
Time off Messages: Adding hyperlink in a message for opening in new tab.
Take Rules in Employee Central Time Off help in additional validation and providing more information to users while requesting, editing or cancelling a leave. The information mentioned above is displayed in the form of messages. In this blog I will address the requirement, which is to include a hyperlink. On clicking this hyperlink, employee will have the link opened in a new tab in browser.
Example Requirement: The business wants to raise a message when the employee is applying for leaves, informing the employees to visit the company portal to access latest leave policy. There should be a hyperlink in the information message which employee can click to visit the portal.
Configuration Steps:
Step 1: Create a message definition as shown below:
For more information regarding Long Team Unpaid Leave policy, please click. [xurl=http://www.sap.com/]Here[/xurl]
(I have used the example link to direct to www.sap.com.)
Step 2: Write a business rule, that will be attached in the next step. (I am not adding any conditions in the if block, as I want the message to displayed whenever the Unpaid time off leave is requested.)
Step 3: Add the Business Rule to the Time Type for which the message should be displayed.
Testing: Request for the Time off and see that this message is displayed. Up on clicking the link, the address is opened in a new tab.
Final Thoughts:
- The above has been achieved by using the BB Codes. The other codes that can be used to customize the messages are as below:
- The [url]…[/url] code provided in the above table opens the link in the same page, however this is not much usable as the page is opened in the same page. You will have to place the link within [xurl]…[/xurl] to get the page opened in new browser tab upon clicking the hyperlink.
Nice ..
Thank you baladeba behera , Glad that you liked it.
Dear Aadil,
I found this configuration very interesting and I tried to apply it to my case where I need to raise a warning message when changing Name and Surname from Personal Info:
Unfortunately in my case I keep seeing the extended URL. Is this supported only for Time Off rules?
Thanks,
Gianluca
Hi Gianluca,
Did you find an answer to your question? I am searching for the same possibility.
KR Signe.
Hi Gianluca,
I'm watching right now these behavior. I thought that it was still possible. I made it once time but right now it is not working anymore.
Did you find any solution?
Thanks and regards.
Alexis Sánchez
Hi Gianluca/ Signe / Alexis,
As per Knowledge Base Article 2792057 - How to insert hyperlink or custom URL in standard email notification template, these URLs will work if HTML is enabled.
Make sure that HTML e-mail notification is enabled by going to admin tools > company system and logo settings > Enable HTML e-mail notifications
Regards,
Razia
And if you want to open with a new tab, please try as below:
Hi Fannie,
Thank you very much - the "enable HTML email notifications" was already enabled - But your coding worked so might have been the wrong coding I had found. Is there a place where this coding is mentioned maybe also with other possibilities?
KR Signe.
Hi Signe,
I just searched this code from internet.
I tried this in manage data > message definition, it is totally working.
Please kindly have a try, if it works in message definition, then we can say there is no problem with code.
It might not be supported in standard email notification template.
BR,
Fannie
Hi Fannie,
Yes as I wrote above it is working - Also for normal Message Definitions.
Very nice - But I think these is a lack of info on it though 🙂
KR Signe.
Hi Razia Sultana,
The KBA you shared is for hyperlink in EC alert message (email notification), my question is can you use hyperlink in message defintion (the pop up message on the screen). I tried it in message definition and it didn't work.
Based on the comments below, I think there are some confusion over alert message and message definition.
My code is
Hi Aadil,
Good Morning.
I was able to get it using the Code below
By clicking submit below, I confirm that I reviewed, understand,
and will comply with Flexible Workplace Policy (the "Policy").
Click Here: <a href="https://help.sap.com">the Policy</a>
Also when I use this code it open in the same window, please advice/suggest what can be added so that when I click the Hyperlink it take me to a new tab.
Also please advice how can make the sentence in bold letters and choose a different color when the above warning msg pops up.
Please advice.
Subramaniyam
Hi All,
I tried both codes in the message definition either of them doesn't work can someone share the right code to embed the link in the message definition
Thanks