function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nagennagen 

Overiding Edit Button

Hi,
Hi I am overriding the Edit Button with this code in the s-control

<html>
<head>
<script src="/soap/ajax/8.0/connection.js">
</script>
<script>
function init()
{
window.parent.location.href = "{!URLFOR($Action.Donation__c.Edit, Donation__c.Id,[retURL=URLFOR($Action.Donation__c.Edit, Donation__c.Id)], true)}";
}
</script>
</head>
<body onload="init()">
<p>&nbsp;</p>
</body>
</html>

When the edit button is clicked the control is transfered to the edit page properly, but when I click the save button, the record is saved and the same page is displayed, it does not go back to the details page (with inline editng and edit button) even when I press the cancel button the same page is display as the control is being transfered to the s-control which is transfering back to the edit page, is there some way to disable this on the edit page is displayed..


can i do something like this..
<html>
<head>
<script src="/soap/ajax/8.0/connection.js">
</script>
<script>
function init()
{
if (Page is Detals_Page)
window.parent.location.href = "{!URLFOR($Action.Donation__c.Edit, Donation__c.Id,[retURL=URLFOR($Action.Donation__c.Edit, Donation__c.Id)], true)}";
Else
  window.parent.location.href = "{!URLFOR($Action.Donation__c.view , Donation__c.Id,[retURL=URLFOR($Action.Donation__c.view,
}
</script>
</head>
<body onload="init()">
<p>&nbsp;</p>
</body>
</html>
Thanks
N
sapsap
try passing saveURL which redirects to detail page
nagennagen
How do I use the saveURL?

I am new to saleforce
Thanks
werewolfwerewolf
SaveURL is just a URL parameter which is URL-encoded (you know, with those %20 kind of things in it) which tells the page where to go when Save is clicked.