You need to sign in to do that
Don't have an account?
Btormar
Override 'New' Opportunity button
I am trying to override the 'New' opportunity button as I'd like to pass some values when it is clicked (opportunity name = account name among others). The code below works - however, it's doing a 'double-load' when I click the new button. Does anyone know why it does that or how I can fix it? For instance, if I have several record types to choose from it will ask me twice which record type I want before it takes me to the new opportunity screen.
<html>
<head>
<script src="/soap/ajax/8.0/connection.js">
</script>
<script>
function new_URL()
{
window.parent.location.href ="{!URLFOR($Action.Opportunity.New,null,[accid=Account.Id,opp3= Account.Name ],TRUE)}";
}
</script>
</head>
<body onload="new_URL()">
<p> </p>
</body>
</html>
<head>
<script src="/soap/ajax/8.0/connection.js">
</script>
<script>
function new_URL()
{
window.parent.location.href ="{!URLFOR($Action.Opportunity.New,null,[accid=Account.Id,opp3= Account.Name ],TRUE)}";
}
</script>
</head>
<body onload="new_URL()">
<p> </p>
</body>
</html>
Thanks!
function new_URL()
{
parent.location.href ="{!URLFOR($Action.Opportunity.New,null,[accid=Account.Id,opp3= Account.Name ],TRUE)}";
}
</script>
Don't call the object Window !
just try to made it like this ...
Thanks guys - all good suggestions, however, no luck unfortunately.
I even tried hard-coding the link, and still it does the 'double-load'...
Don't get me wrong, there will still be a delay in the response time between pages due to the fact that it is an sControl but you should bypass that second selection of recordtype.
I am also having same problem in overriding one of my custom object new button (Which uses the Record Type).
Does any one from community has got any workarround? id so then please reply to this thread.
Thanks
V. R.
We had the need for this too, but from the Opportunity related list on the Account detail page. The following URL on a custom button on the Opportunity worked fine. Don't know if this helps. We would never want to create and opportunity from the Opportunity Home page/tab, just from Accounts, so this approach might not help all.
/006/e?retURL=%2F{!Account.Id}&accid={!Account.Id}&opp3={!Account.Name}
The standard button for this list is "New Opportunity". I've replaced this with our own "New Opportunity" button, as described above.
I came across this post when working on a related problem. Here is a link to what I ended up with:
Automatically setting the record type of a detail object based on the record type of its master object
Keith