Skip to Content
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:

  1. The above has been achieved by using the BB Codes. The other codes that can be used to customize the messages are as below:

  1. 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.
12 Comments
You must be Logged on to comment or reply to a post.
  • 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/ 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

      • 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 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