You need to sign in to do that
Don't have an account?
WesGray
URLFOR and "current" records
I am trying to make an S-control which displays a list of rows and lets the user click on a row to view the detail page. Creating the link for them to click on has proved tricky because using URLFOR only seems to work if the current S-control was passed in a "current" Id. I have managed to work around this by passing the Id to a second S-control and having that S-control do the URLFOR and immediately refresh to the desired detail page. That is a pretty ugly hack though and I am sure hoping someone has a better solution!
To clarify what I am saying, here is the hack:
S-control 1:
output += "<td class='dataCol col02'>" +
"<a href='" + "{!URLFOR($SControl.Employee_View)}" +
"&eid=" + EmployeeRow.Id + "'>" + EmployeeRow.Name + "</a></td>";
S-control Employee_View:
<html>
<head>
<script language="javascript" type="text/javascript">
function initPage()
{
window.parent.window.location="{!URLFOR($Action.DDEmployee__c.View, DDEmployee__c.Id)}";
}
</script>
</head>
<body onload="initPage();">
</body>
</html>
To clarify what I am saying, here is the hack:
S-control 1:
output += "<td class='dataCol col02'>" +
"<a href='" + "{!URLFOR($SControl.Employee_View)}" +
"&eid=" + EmployeeRow.Id + "'>" + EmployeeRow.Name + "</a></td>";
S-control Employee_View:
<html>
<head>
<script language="javascript" type="text/javascript">
function initPage()
{
window.parent.window.location="{!URLFOR($Action.DDEmployee__c.View, DDEmployee__c.Id)}";
}
</script>
</head>
<body onload="initPage();">
</body>
</html>