You need to sign in to do that
Don't have an account?
BRupholdt
Retrieving the retURL in an S-control
I created a custom button to automatically edit a field and save the changes using the retURL and passing the form parameters. It works great. I then created a custom edit button on the object to specify which record type to use. It works great but now the first button doesn't work.
I think the field values from the first S-control aren't being passed through the S-control of the custom Edit. Is there a way to read the retURL passed to the Edit page? If so, that would solve my problem as I could simply append it to the url to exit the page. When I tried to do so, I only get a null value so I know either I'm not doing it right or it's not possible.
Did you override the standard button?
You can also invoke the standard edit button in the custom edit button code.
Could you provide some more info?
Kaushik
I did override the standard Edit button. I'm doing this on Opportunities. This works fine for keeping users without access from editing records based on the record type.
Here is the Edit button override:
userID = '{!$User.Id}'
adminID = 'omitted'
integrationID = 'omitted'
accountingID = 'omitted'
lockedRecordTypeID = 'omitted'
unlockedRecordTypeID = 'omitted'
recordTypeID = "{!Opportunity.RecordTypeId}"
editURL = "{!URLFOR($Action.Opportunity.Edit, Opportunity.Id, [retURL=URLFOR($Action.Opportunity.View, Opportunity.Id)],true)}"
viewURL = "{!URLFOR($Action.Opportunity.View, Opportunity.Id)}";
if(!( userID==adminID | userID==integrationID | userID==accountingID )){
if (recordTypeID==lockedRecordTypeID) {
alert("This order is locked for processing.\n\nHave Accounting reject the order for you.")
window.parent.location.href = viewURL
} else {
window.parent.location.href = editURL
}
} else
window.parent.location.href = editURL
And here is the custom "Reject" button. It worked until I made the custom Edit override.
window.parent.parent.location.href='/{!Opportunity.Id}/e?retURL=%2F{!Opportunity.Id}&opp11=Rejected&save=1';
I figure if I could access the retURL from the Reject button, I could pass it along to the regular edit page in the editURL variable of the first script.
Thanks for looking at this. I had given up on anyone replying.
this.parent.location.href="{!URLFOR( $Action.Opportunity.Edit , Opportunity.Id ,[retURL=URLFOR( $Action.Opportunity.View , Opportunity.Id ),Name="Test"],true )}";
Message Edited by Kaushik on 06-21-2007 03:24 PM