Providing an Hyperlink to a related entity through Communication screen

By | August 20, 2011
In today’s software world reducing number of clicks is an essential task. In CRM we can have communications against all the entities. How helpful it would be; if I can provide link to parent entity on communication screen itself? This way I can go from communication find screen and then also visit the relevant entity record against which that communication is created.

Below is the same thing we have implemented for communications against Quote. On the communication screen we have provided hyperlink to navigate to corresponding quote.

Below is how you can achieve the same.

Script

sQuoteId = eWare.GetContextInfo(“communication”,”comm_quoteid”);

if(sQuoteId == “null” || sQuoteId == “undefined” || sQuoteId == “”)sQuoteId = “0”;

if(sQuoteId != “0”)

{

sQuoteQry = ” Select * from Quotes (nolock) where quot_orderQuoteId = ‘”+sQuoteId+”‘ and quot_deleted is null “;

ObjQuote = eWare.CreateQueryObj(sQuoteQry);

ObjQuote.SelectSQL();

if(!ObjQuote.eof)

{

sQuoteRef = new String(ObjQuote(“quot_reference”));

}

}

The action required to redirect to standard Quote screen is 1469. Hence the URL is created and its maintained in a hidden field.

sQuoteUrl = eWare.URL(“1469”);

On onload we have added the hyperlink to the caption of a field. Refer this code that is added in custom content of the screen.


//Custom Content

Script

function DispQuote()

{

var sUrl = “”;

var sQuote = “”;

var CommNoteHTML= “”;

//’Get Quote Url

if(document.EntryForm.QuoteUrl)

{

sUrl = document.EntryForm.QuoteUrl.value;

}

//’Get Quote Reference number

if(document.EntryForm.sQuoteId)

{

sQuote = document.EntryForm.sQuoteId.value;

}

CommNoteHTML = document.getElementById(“_captcomm_note”).innerHTML;

//’Append the href in a caption

if(document.getElementById(“_captcomm_note”))

{

document.getElementById(“_captcomm_note”).innerHTML = CommNoteHTML+” < A href=" +sUrl+" > “+sQuote+” < /A > “;

}

}


If you find this content useful, please drop us an email at crm@greytrix.com.