Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to get the Portal URL in workflow

(0) ShareShare
ReportReport
Posted on by 55,410 Moderator

Hi,

I have portals configured for dev, test & prod environment. I need to send a portal link (e.g. https://<portalurl>/?<recordid>) of a record in an email via workflow. The portal url is different for all the environment.

How will I add the portal url dynamically in the email so that it redirects to the correct portal url i.e. dev, test * prod?

*This post is locked for comments

  • Prashant Wani Profile Picture
    441 on at
    RE: How to get the Portal URL in workflow

    Hey Ravi, I'm also trying to achieve the same. Could you please share sample code of custom activity here. 

    It would be helpful for me to implement the same thing in faster way!

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: How to get the Portal URL in workflow

    Hi All,

    As suggested, I ended up with the custom workflow activity to build the URL dynamically whilst storing the domain in a custom config entity.  

  • Verified answer
    Dmytro Rutkovskyi Profile Picture
    1,835 on at
    RE: How to get the Portal URL in workflow

    If you email somehow connected to website,  you can use website.adx_primarydomainname as had been already suggested.

    But most clean way will be to write custom action (plugin) to return this url from the active bindings for required website. Because primary domain can be not the most relevant (especially if you migrate web sites between environments), or site can has multiple domains.

    There are other options to use "site settings" entity, "settings" entity or custom similar entity

  • Verified answer
    oliver.rodrigues Profile Picture
    4,052 on at
    RE: How to get the Portal URL in workflow

    I suggest creating a custom workflow that retrieves the "primary domain" field from the Website entity, this custom workflow can have an output parameter that you can use in your workflows

  • Verified answer
    PranavShroti Profile Picture
    4,510 on at
    RE: How to get the Portal URL in workflow

    Hi Ravi,

    I did similar thing for a customer. Where in on load of an new email record, I was applying predefined templates with tags. All using JS. Once are in onload you can get the template and replace the tags with the Dynamic Portal URL (this you can get from config or similar). Template then can be applied to Email record.

    I am sure you will get the desired result.

  • Verica Hodder Profile Picture
    10 on at
    RE: How to get the Portal URL in workflow

    Exactly what I'm after too.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans