Let me try that again without the script tags: And the code is...
function setHyperLink(strASSFieldname, strCustomFilePath, strEntityName, strPrimaryKey) {
// to see if on view mode
if (!document.getElementById(strASSFieldname)) {
//Get the record information
var product = document.getElementById("_Data" + strASSFieldname);
var productid = document.getElementById("_HIDDEN" + strASSFieldname);
var productname = document.getElementById("_HIDDEN" + strASSFieldname + "TEXT");
//If we have an ID field, lets create our link
if (productid != undefined) {
//Get the URL
var strPath = document.URL;
var arrayApp = strPath.split("crmtng");
var URL = arrayApp[0];
//Get our session ID and context
var arrayContext = strPath.split("?");
var strContextInfo = arrayContext[1];
//Build our URL
var strURL = URL + "crmtng/CustomPages/" + strCustomFilePath + "?" + strPrimaryKey + "=" + productid.value + "&" + strContextInfo + "&J=" + strCustomFilePath + "&=F=" + strEntityName;
//Add the anchor link to our text
var strCaptionText = productname.value;
strFullCaption = "<a>" + strCaptionText + "</a>";
product.innerHTML = strFullCaption;
}
}
}