2

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.

Andrew N
  • 502
  • 7
  • 20
  • Really good catch. You can suggest an idea here https://experience.dynamics.com/ideas/list/?forum=1c8854a6-5cdf-4681-bba8-4b6b806fcf7d – Arun Vinoth-Precog Tech - MVP Nov 22 '18 at 05:32
  • 1
    Thanks for the idea. If anyone wants to upvote this idea, then go and vote here. https://experience.dynamics.com/ideas/idea/?ideaid=76633bde-62f1-e811-a140-0003ff68a2bf – Andrew N Nov 26 '18 at 10:07
  • Or you can use the [Dynamics365 workflow tools](https://github.com/demianrasko/Dynamics-365-Workflow-Tools) and use the new [Get App Record URL](https://github.com/demianrasko/Dynamics-365-Workflow-Tools/blob/master/docs/GetAppRecordUrl.md) feature. – user11029068 Feb 07 '19 at 14:53

2 Answers2

1

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

  • This would not work for me, as my question was about getting the app ID inside a Workflow. Please see my question. – Andrew N Aug 04 '20 at 05:48
0

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
    Andrew Butenko's workaround isnt suitable for my requirement as I have multiple subscriptions for each environment. As the App ID is different in each environment, it means manual changes with each deployment. I've written a CWA to do the same thing and it gets the App ID from a config entity so that there are no changes needed for each environment. – Andrew N Dec 11 '18 at 14:57