Tech Support > Microsoft Windows > Windows CRM > Hyperlink to case in 3.0
Hyperlink to case in 3.0
Posted by Patrick on February 13th, 2006


This question has been hinted around quite a bit but as of yet I don't see
that it's been answered or followed up on...so here it is.

It seems that prior to 3.0, quite a few people were creating links to a case
within a workflow generated email. To do this, &incident.incidentid; would be
used within the hyperlink to populate the appropriate case number.

As of 3.0, the CRM servers expect the incident id (GUID or unique
identifier) rather than the actual case number.

Has anyone found a way to perform the same logic in 3.0 that
&incident.incidentid; performed in previous versions?

Obviously {!Case:Case Number} will pull back the case number...but is there
a way to do the same for the UID?

Thanks!

Patrick

Posted by Potsic on March 15th, 2006


Hi Patrick:

Here's what I did to get a hyperlink in an email for a workflow. I did this
for Opportunities, but it should work on any entity that can be customized.
I did this for Cases, Accounts, Contacts, Leads so far. Here's what I did
for opportunities, but the concept is the same for cases, etc.

In CRM 3.0:
1. Add a new field to the Opportunities Entity using the CRM interface.
2. Call the field Opportunity URL.
3. Type nvarchar, no constraint, size 200 should be plenty.
4. Save and Publish Changes.

In SQL Server:
5. Add a trigger to the OpportunitiesExtensionBase table.
6. The code for the trigger should be something like this:
CREATE TRIGGER update_newopportunityurl ON [dbo].[OpportunityExtensionBase]
FOR INSERT, UPDATE
AS

update [dbo].[OpportunityExtensionBase] set New_opportunityURL = OpportunityId
update [dbo].[OpportunityExtensionBase] set New_opportunityURL = N'<a
href="https://<insert crm server url>/SFA/opps/edit.aspx?id={' +
New_opportunityURL + N'}">Click here to view opportunity</a>'

Now when an opportunity is created or updated (for existing records if any),
our new field Opportunity URL will be populated with all the data needed to
create a hyperlink for an email.

In a workflow all you need to do is insert the slug for the Opportunity URL
to send the hyperlink in an email back to this opportunity. I haven't looked
at putting this into reports yet, as I'm new to CRM, so I may modify this
solution to accommodate both.

No assemblies to build or http modules, no JavaScript to write, no forms to
hide tabs on, no writing your own save function. This happens at the
database level without failure.

--
sp


"Patrick" wrote:

Posted by Vic Coleman on April 21st, 2006


Thanks for posting this procedure. It was exactly what I needed and works
like a charm. Very helpful.

"Potsic" wrote:

Posted by Jo Savidge on May 4th, 2006


But this relies on created unsupported SQL triggers, is there a way of
getting the GUID from a javascript onchange/load/save event?

Jo Savidge

"Vic Coleman" wrote:

Posted by Potsic on May 4th, 2006


Hi Jo,

This was the easiest way to accomplish this task. There is another thread
that talks about building a workflow assembly. I had responed to his request
for a solution and he responed with his workflow code. At the time, I needed
this functionality before I was able to get into workflow assemblies. Since
then I have built other workflow assembiles and may change this idea, but
this process works and works everytime without fail. Since it works very
well, at this time I do not see any reason to change this process.

I don't know about the solution beging unsupported since it is a very common
process in SQL server.

We did try using a javascript to populate the GUID to another field to make
up our URL, however there were issues with this and situtaions where the GUID
was not populated. The situation where it failed was when a new record is
created. The user types in the information on the web form and then hits
"save and close". At that time the GUID is not populated until the
information is sent to the database. The web form has closed and therefore
the javascript cannot place the GUID in our new field. It does work fine on
"save" as long as you have the event get triggered "onload", but because it
wasn't reliable enough to make sure it happened everytime, we ended up
dropping this as a solution.

There appears to be only two options that will work everytime, build a
workflow assembly to get the GUID to generate your URL or use a SQL trigger
to populate a custom field with either the GUID or your URL to the object.

Good luck.

--
sp


"Jo Savidge" wrote:

Posted by Jo Savidge on July 4th, 2006


For anyone who is interested, where is a bit of Javascript which accomplishes
this task:

var id = crmForm.ObjectId;
crmForm.all.description.DataValue="http://localhost/sfa/opps/edit.aspx?id="
+ id;

In the above example I have used opportunities, but this could be used for
cases very easily.

Jo Savidge
------------

"Potsic" wrote:


Similar Posts