In this blog, we show you how to create a Responsive Editable Grid in Canvas App as quick as possible with the Horizontal container and Vertical container.
This post is a sequel to a blog entry written late last year by my colleague Aki Rova. Click here to read more about it.
As pointed out by my friend Aki on his post, there's quite of an interest out there from our group of users asking about the workflows ability (or its inability thereof) to send emails with an embedded hyperlink or URLs. This is most especially helpful if the user is making available certain resources from their company's website or a hyperlink to the company's web portal and most importantly a link to a record in a CRM entity as described in detail in the previous post.
What I worked on involved just a little bit more; the requirement was to make available a URL to an SQL report. The challenge is that we will need to pass a few parameters into that report. In short we needed to embed a dynamic URL to our little workflow generated email. And so off I went.
I really didn't have an issue at all with building the dynamic URL; my approach was to do it at the record level. As a record gets created, a specific dynamic URL is also built and is persisted into a custom attribute in the record the next time it is loaded or after it is first saved. The script that accomplishes this is really very simple.
//I wanna make sure that this small code will still work after org import/re-import
if (crmForm.ObjectId!=null &&
//the report guid is given here as a static parameter
reporturl2 = "&helpID=report1.rdl";
//build the dynamic parameters
param1 = "&records=" + crmForm.ObjectId;
param2 = "&recordType=" + crmForm.all.po_reportParam.DataValue;
crmForm.all.po_guid.DataValue = objectGuid;
//build the complete URL with parameters
crmForm.all.po_reporturl.DataValue = reportUrl1 + param1 + param2 + reportUrl2;
The next step is to build the workflow. My next challenge is to be able to pass this report URL string into a workflow generated email and make it a hyperlink so users will just have to click on it. Now the out of the box feature doesn't quite support this just yet. What it does is embed my report URL into the workflow generated email as a string. But I want to accomplish more than this.
Many CRM developers may already have had this challenge overcome before, and there could be many solutions out there, but the best solution we have found so far is through a workflow set of utilities that was made available from another Microsoft partner. Here is the link to the post by Jim Steger.
This URL Builder accepts a string parameter and embeds this URL into the workflow generated email.
All I need to do then is to pass my report URL from a custom attribute in my entity and into the URL field as illustrated above. What the URL Builder does is it adds a 'href' tag to the passed string to make it be a hyperlink when rendered in an email.
My initial tests proved that the solution was that simple, and so my next logical step was to have the solution deployed in production.
As I was monitoring how it was working in production, I had encountered an issue which didn't make sense at first. The workflow was crashing that it had completely failed to work in production. No email ever came out from my workflow. I know that the URL that I was passing was correct because I can copy and paste it in a browser and it would always give me the resource that I wanted to access.
Took me several hours to figure out what ended up was a very simple mistake. The URL Builder was assuming that all passed parameters are UTF-8 encoded. I was assuming that it would encode it for me, but then I fully understand now looking back that it wouldn't be able to, otherwise encoding the whole URL string would give me an invalid URL.
//build the dynamic parameters
param1 = "&records=" + encodeURIComponent(crmForm.ObjectId);
param2 = "&recordType=" +
This issue here is simple, yet it could cost you a few hours, or even a day. Hopefully this post will save you from being in the same pit I was.