Getting the appid included in the Record URL(Dynamic) in a Dynamics 365 email workflow

2.1k views Asked by At

I've been tasked with creating a workflow in Dynamics 365 which can send emails (the easy bit). However, the email has a link to the record (also easy using the Record URL(Dynamic) attribute). However, we use Apps in our Dynamics instance and the link generated by the workflow using Record URL(Dynamic) doesn't include the app id and so when users click the link they are taken to Dynamics but are now outside the app.

My question is, is there a supported way to appending the App Id to the Record URL(Dynamic) attribute?

I've already searched for answers to this and cant find any. My solution was to create an Action which takes as input the Record and app ID, appends them and outputs them as an output parameter. This works to be honest, but I'm wondering if I'm reinventing the wheel and there is an easier way to achieve this.

Thanks and hope this helps anyone else with the same issue.

2

There are 2 answers

1
Arun Vinoth-Precog Tech - MVP On

While we are waiting for MS to give the OOB option to choose Model driven app Id & embed in Record url of WF, I recommend you to follow Andrew Butenko’s workaround using Ultimate Workflow Toolkit to achieve it with no code.

This is basically using UWT custom step to append App Id with Record url on the fly.

1
Mohammad Khaleel On

We can get the Application ID from Xrm.Utility.getGlobalContext(); The application ID is one of the properties that returned

var globalContext = Xrm.Utility.getGlobalContext();
globalContext.getCurrentAppProperties().then(
    function success(app) { console.log(app.appId); }, function errorCallback() { console.log("Error"); });

For more details refer to Here