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
KIBLKIBL 

Custom Button

I am creating a custom button on the Account Opportunity Related list to create a new Opportunity.  I am bringing over a couple of fields to the new Opportunity.  Below is the info I have but it is not working.  I cannot get my URL return value right.  I click on Save and it give me a Page Cannot Be Displayed error.  Also,  I can't get my sales rep to pre populate.
 
Can you help?
 
https://na3.salesforce.com//006/e?retURL=%2F006%2Fo
&opp4_lkid={!Account.Id}
&opp4={!Account.Name}
&00N50000001Zixg={!Account.Market_Code__c}
&00N50000001ZiyJ={!Account.Sales_Rep__c}
&00N50000001aZCQ={!Account.KI_Customer__c}
&00N50000001Ziyd={!Account.District__c}
&/0065000000AKTzJ/e?retURL=%2F0065000000AKTzJ
sfdcfoxsfdcfox
Code:
/0065000000AKTzJ/e?retURL=%2F0065000000AKTzJ&opp4_lkid={!Account.Id}&opp4={!Account.Name}&00N50000001Zixg={!Account.Market_Code__c}&00N50000001ZiyJ={!Account.Sales_Rep__c}&00N50000001aZCQ={!Account.KI_Customer__c}&00N50000001Ziyd={!Account.District__c}

 
That should do what you're looking for...
KIBLKIBL
I tried this and it opens up an existing opportunity.    Here is what I have that gets me a new Opp but I can't get it to save.
 
https://na3.salesforce.com//006/e?retURL=%2F006%2Fo
&opp4_lkid={!Account.Id}
&opp4={!Account.Name}
&00N50000001Zixg={!Account.Market_Code__c}
&00N50000001ZiyJ={!Account.Sales_Rep__c}
&00N50000001aZCQ={!Account.KI_Customer__c}
&00N50000001Ziyd={!Account.District__c}
&/0065000000AKTzJ/e?retURL=%2F0065000000AKTzJ
 
sfdcfoxsfdcfox
Oh. See, that's what I get for not reading the question properly. Try THIS instead...

Code:
/006/e?opp4_lkid={!Account.Id}&opp4={!Account.Name}&00N50000001Zixg={!Account.Market_Code__c}&00N50000001ZiyJ={!Account.Sales_Rep__c}&00N50000001aZCQ={!Account.KI_Customer__c}&00N50000001Ziyd={!Account.District__c}&retURL=%2F006%2Fo

As far as "Sales Rep" not populating, if it's a lookup field, don't forget the _lkid parameter, and if it's a picklist... Well, I have no idea, because I haven't gotten picklists to work in custom links since they re-programmed them in Winter '06 or so. Maybe someone else can help out with that one. But your retURL was definately incorrect, and that's how I'd fix it.
KIBLKIBL

That worked!!  Thanks!

I do still have an issue with the salesrep.  It is a picklist so if anyone has any ideas please let me know.

kevinedelmannkevinedelmann
For your picklist, just put the value section in quotes and it should work.  I.e. opp11="Received RFP"

Hope this helps.

Kevin
KIBLKIBL

I tried and that did not work.  I would have to put the quotes around like this:  &00N50000001ZiyJ="{!Account.Sales_Rep__c}".  Is this what you meant?  My Sales Rep field is a picklist. 

kevinedelmannkevinedelmann
I don't think that will work.  However, you could try referencing the picklist value in a custom formula field that is not shown on the page layout and then use the custom formula field value in the button link.