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
Michael MinnekeerMichael Minnekeer 

ID on merge field in custom button returns as 0

Hi,

I am trying to create a simple button for an Opportunity that brings the user to a new record page for a custom Object called Policies(Policies__c). The reason I need a custom button is because there is an account lookup field that I want auto populated when clicking new policy off the opportunity. 

However when inserting the Opportunity Name and and Opportunity ID in the custom field for the opportunity lookup it returns as expected with the correct name but the ID returns as 0. I could just remove the ID part and it would work but it causes confusion for a user if there are multiple opps with the same name for example.

Here is what it looks like if I was to hit the default button(doesnt contain Account lookup)
/a04/e?
CF00NN0000001MqbU=testy+testy+-+Risk+Sales+-+2015-11-03
&CF00NN0000001MqbU_lkid=006N0000007UtHL
&retURL=%2F006N0000007UtHL

My Custom one looks like this
/a04/e?
&CF00NN0000001MqbU={!Opportunity.Name}
&CF00NN0000001MqbU_lkid={!Opportunity.Id}
&CF00NN0000001MqO6={!Opportunity.Account}
&CF00NN0000001MqO6_lkid={!Opportunity.AccountId}
&retURL={!Opportunity.Id}

It returns the Account ID but not the opp ID
https://cs6.salesforce.com/a04/e?
&CF00NN0000001MqbU=testy+testy+-+Risk+Sales+-+2015-11-04&
CF00NN0000001MqbU_lkid=0
&CF00NN0000001MqO6=testy+testy
&CF00NN0000001MqO6_lkid=001N000000XgEcH
&retURL=0


 
Best Answer chosen by Michael Minnekeer
scottbcovertscottbcovert
Hi Michael,

Not sure if I've ever seen this before but I came across this post in the success community that sounds similar; let me know if this helps:

https://success.salesforce.com/answers?id=90630000000DHGYAA4

All Answers

scottbcovertscottbcovert
Hi Michael,

Not sure if I've ever seen this before but I came across this post in the success community that sounds similar; let me know if this helps:

https://success.salesforce.com/answers?id=90630000000DHGYAA4
This was selected as the best answer
Michael MinnekeerMichael Minnekeer
That was exactly it, there was some custom field I wasn't aware of the was named just ID__C like the example you provided. removing the field fixed the issue even though the merge field wasn't using that field.
scottbcovertscottbcovert
Great; glad I could help!