You need to sign in to do that
Don't have an account?
MattL
Overriding New Button results in infinite loop
I'm trying to develop custom code for overloading the New button on a related list. This will populate not just the Contact name (as the standard functionality does), but also populate the Member Status and Group fields from the Contact, automatically.
Code:
Yet every time I click on the button, the first URL it takes me to is the proper one. Then, it reloads the page, loses the values... and then reloads the page again. And continues to just sit there reloading the page. I never actually see the new object dialog show up. Can anyone assist?
Code:
<html> <head> <script src="/soap/ajax/9.0/connection.js"></script> <script language="Javascript"> function replace() { parent.document.location.href="/a00/e?00N40000001RC56={!Contact.Name}&00N40000001RC69={!Contact.Member_Status__c}&00N40000001RC64={!Contact.Group__c}"; } </script> </head> <body onload="replace()"> </body> </html>
Yet every time I click on the button, the first URL it takes me to is the proper one. Then, it reloads the page, loses the values... and then reloads the page again. And continues to just sit there reloading the page. I never actually see the new object dialog show up. Can anyone assist?
i think your code can add nooverride=1 to avoid falling into this hole. check out nooverride in the online help.
Quick different question, if ya could answer it...
It isn't actually sending the values it should. When the link does appear, all the = with the merge fields disappear.
It first redirects to:
https://na2.salesforce.com/a00/e?CF00N40000001RX56=Test+Testington&CF00N40000001XC56_lkid=003X000000Mo2z3&scontrolCaching=1&retURL=%2F0034000000MX2z3
And then:
https://na2.salesforce.com/a00/e?nooverride=1&CF00N40000001RX56=&CF00N40000001XC69=&CF00X40000001RC64=
Any ideas?
those '&' chars.
something like this
Code:
hope it helps.
Message Edited by Ron Hess on 08-06-2007 07:58 PM
It looks like there's the possibility that this method doesn't work at all, and instead the method to use is the $URLFOR() function.
That's a problem for me, however, as both of the other variables I'm trying to pass are picklists. Using a picklist value inside a formula makes Salesforce.com complain "You must use ISPICKVAL() or CASE()"... which would mean 6-9 if statements for the first variable... and then NESTED inside each of those are 20 more if statements for the second variable... meaning I'd have to write 200 if statements to get this code to work. At this point, we're stuck, and just using the default functionality of the New button. :/
I guess this thread is right place to put my question.. I have developed similar kind of link for my use.
But now requirement is to populate picklist value. I am copying a record by clicking button.
0xxx000xxx0xxxx={!Account.Status__c} // Status is picklist -This is not working.
All the picklist fields values are not populated in new record. Any help around this highly appreciated