You need to sign in to do that
Don't have an account?
icbomber38
S Control - Change Opportunity Layout on Close Won
I've been getting some help from one of the SFDC people (which has been great compared to previous experiences). We're trying to archive Won opps and they gave me some java for an s-control that was designed to do the same thing for cases:
<script language="JavaScript">
function redirect() {
var retURL = escape("/{!Opportunity_ID}");
parent.frames.location.replace("/{!Opportunity_ID}/s?retURL="; + retURL +"&RecordType=012300000000AA3" )
}
redirect();
</script>
function redirect() {
var retURL = escape("/{!Opportunity_ID}");
parent.frames.location.replace("/{!Opportunity_ID}/s?retURL="; + retURL +"&RecordType=012300000000AA3" )
}
redirect();
</script>
I went ahead and created a new page layout (basically making all the field read only) but, as a complete novice, I have no idea what to do next. She recommended I come here for more help - any guidance would be greatly appreciated. The code in RED makes no sense to me - is that being grabbed from the record when the s-control is executed?
Thank you,
Lee
you will have to edit the actual ID to match the record type id to one that you want to end up with when the custom link is finished running.
you can get this ID from your system, but you need to have the record type defined, and the new page layout specified as the layout which will appear when records have this record type.
to get this ID , go to a record, click [change] next to the record type field on the layout, then look in the address bar for the ID, it should be there somewhere, you may have to add the record type field to one of your layouts.
Ron - I went ahead and set everything up. I click on the Custom Link ARCHIVE I created and I get this text framed in the SFDC tabs:
<script language="JavaScript"> function redirect() { var retURL = escape("/00630000002epxM"); parent.frames.location.replace("/00630000002epxM/s?retURL="; + retURL +"&RecordType=012300000004tKm" ) } redirect(); </script>
Here's the code I have for the S Control:
<script language="JavaScript">
function redirect() {
var retURL = escape("/{!Opportunity_ID}");
parent.frames.location.replace("/{!Opportunity_ID}/s?retURL="; + retURL +"&RecordType=012300000004tKm" )
}
redirect();
</script>
Am I missing a character somewhere? Needless to say my Opportunity is not "archived".
Thank you for your help. My boss is all over me to get this going but he forgets I am not a programmer.
Lee
i think the
/s?
should be
/e?
and you will need added to the redirect string.
Code:
if it helps here is the entire URL you are trying to construct, ( to pass to reload or redirect() )
in this case it's for a lead converting to a new record type
Code:
/e specifies the Edit page for the object ( leads because the 00Q identifier)
so 00Q30000000Ydei is the lead i started on, this appears again in the retURL
012300000000gpA is the new record type i want the object to have
save=1 causes the edit page to go ahead and save
Message Edited by Ron Hess on 05-18-2006 04:00 PM
Thanks again Ron but still not geting anywhere. I think the original code my SFDC contact sent me has a bunch of extra characters that are giving me problems. I've looked at a bunch of code designed to do similar things and they all seem much shorter without all the & and " stuff.
I'm not a programmer at all so it could just be that simple. Unfortunately I don't have anyone else to go to internally that know code and SFDC.
Lee
The code you had, with ", etc. had escaped values for characters such as ? and ".
What you want to enter into the actual scontrol window is the un-escaped versions.
An scontrol which should work would look like:
Code:
(I also removed some other unneeded portions).
(You'll need to use your RecordType in place of my AC one).
Message Edited by Scot on 05-19-2006 04:06 PM
Click here to return to the previous page.
The priviledge error probably refers to the operation being performed in the sControl, not the the ability to run the sControl.
In this case, it's probably the ability to edit the opportunity or to save it with the different record type.
I'd try manually changing the opportunity to that record type through the UI - you'll probably get the same error that way.
Well - I have sales manager access and I can edit any opportunity.
Forgive my ignorance, how does one change the record type through the UI?
Thank you very much.
Scot - I finally have it all set up properly. I did away with the java and went with your idea to manually change the record type. As I expected there's one more thing - how do I lock down the Stage of an opportunity (read only) on this record type?
I'm going to post this on the Best Practices board as well to see if there's anyone who can help me.
Thank you,
Lee