AnsweredAssumed Answered

How to Get Value of odf_parent_id on Custom Object?

Question asked by hcook on Jun 29, 2016
Latest reply on Jun 29, 2016 by am1

I think this custom object is going to kill me!

 

I'm trying to allow the user to click a link on an NSQL based portlet, which will take them to the properties screen.

 

I researched and found this article on creating a URL redirection:  http://www.nbl.fi/~nbl3674/Clarity/Link_to_resource_financials.pdf

 

However, the problem is that I can't seem to figure out how to get it to point to my custom object's URL correctly. One of the main problems seems that the URL uses a field called odf_parent_id, but for some reason I can't get this code to pull from my NSQL query. The unique identifier that I CAN see is ID, which saved in the odf_ca_fmc_benefits_mgt table under code.

 

Here is an example of the URL that I NEED it to be:

https://cppm9006.ondemand.ca.com/niku/nu#action:odf.customObject&id=5000000&odf_code=fmc_benefits_mgt&odf_parent_id=5000000

 

Can someone put me out of my misery and help me change the below code so that it will display the above? I've turned the text red on the row that I think needs to be updated:

 

<script language="JavaScript1.2">

var dlim1t = "go2url="

var url1s=window.document.URL;

var go2url = url1s.substring(url1s.indexOf(dlim1t) + (dlim1t.length));

if (url1s.indexOf(dlim1t) == -1)

{

document.write("<br />This portlet is only useful when included on a page");

document.write("<br />that is sent a destination URL within the parameters.<br />");

document.write("<br />Required delimiter &quot;<b>" + dlim1t + "</b>&quot; not sent in URL.<br />");

}

else if (go2url.length == 0)

{

document.write("<br />This portlet is only useful when included on a page");

document.write("<br />that is sent a destination URL within the parameters.<br />");

document.write("<br />Destination URL not provided; unable to redirect.<br />");

}

else if (go2url.length > 0)

{

window.location = "http://c8/niku/app?action=revmgr.resourceFinancials&hdncode=" + go2url + "&id=" +go2url;

}

else

{

document.write("<br />Unable to interpret the following URL:");

document.write("<br /><b>" + window.document.URL +"</b><br />");

}

</script>

 

MUCH MUCH APPRECIATED!!!

 

Heidi

Outcomes