+ Start a Discussion
Art SmorodinArt Smorodin 

Button URL hack. Please help

Hi, 

Please halp me with a problem I am having. Here is what I want to happen: from the Task which is assigned to me I click a button and I get to an Opp create wizard and some of the fields are pre-populatd using values form that Task. I am having some success, but am stuck at one point. 

First of all my Task has 4 custom fields wich I want to grab and use their values to pre-populate fileds on an Opp. User-added image

Now, I created a new button and placed it on the Task layout. The button is Detail Page Button and I am trying to use "URL Hack" to pre populate some of the fields. Here is the code for my button 
/006/e?
ent=Opportunity
&nooverride=1
&RecordType=012U0000000ZW7x
&00NU0000003aXaU=New
&opp4={!Account.Name}
&CF00NU0000003aZwA ={!Contract.Id}
&00NK0000001jB5V = {!Task.Type}      // custom field 
&00NK0000001jB5G = {!Task.Marketing_Activity_Name__c}   // custom field 
&00NK0000001jB5L = {!Task.Last_Referrer__c}   // custom field 
&00NK0000001jB5Q = {!Task.Offer_ID__c}   // custom field 
&retURL=%2F006%2Fo

As you can see I have 4 new fields on an Opportunity Object to accomodate the mapping, I grab their IDs and try to force task field values on them. 

Now the stange part. When I click on the "Create Opportunity" button it does take me to the Opp create wizard and my fields are blank, BUT the Opp wizard URL shows that values are there.

User-added image

Here is the full URL I get once on the Opp create wizard page:
https://cs9.salesforce.com/006/e?ent=Opportunity&nooverride=1&RecordType=012U0000000ZW7x&00NU0000003aXaU=New&opp4=Test+Account+05&00NK0000001jB5V%20=%20Outbound+Prospecting&00NK0000001jB5G%20=%20Marketo+Push+2&00NK0000001jB5L%20=%20www.wsj.com&00NK0000001jB5Q%20=%209876543210&retURL=%2F006%2Fo

Any ideas what might be causing this behaviour? I am completely lost. My "URL Hack" works for some othe fields, but not for these. 

Any input will be appreciated.
Best Answer chosen by Art Smorodin
PuneetsfdcPuneetsfdc
that's strange because its working for me, I am abe to map Task feild values on Opportunity standard and custom fields,
here what I have done,


{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js" )}
var connection = sforce.connection;

var url = '/006/e?ent=Opportunity&
               00N9000000Dynxu={!Task.Custome_Field_1__c}&
               00N9000000Dynxz={!Task.Custome_Field_2__c}&
               00N9000000DTHtF={!Task.Custom_Field_4__c}&
               opp10={!Task.Custome_Field_3__c}';

window.location.href = url;

User-added image

and this is my url

https://sf_instance.salesforce.com/006/e?ent=Opportunity&00N9000000Dynxu=Custom%20Val1&00N9000000Dynxz=Custom%20Val2&00N9000000DTHtF=Custom%20Val4&opp10=Custom%20Val3 (https://sf_instance.salesforce.com/006/e?ent=Opportunity&00N9000000Dynxu=Custom%20Val1&00N9000000Dynxz=Custom%20Val2&00N9000000DTHtF=Custom%20Val4&opp10=Custom%20Val3)
 

All Answers

PuneetsfdcPuneetsfdc
that's strange because its working for me, I am abe to map Task feild values on Opportunity standard and custom fields,
here what I have done,


{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js" )}
var connection = sforce.connection;

var url = '/006/e?ent=Opportunity&
               00N9000000Dynxu={!Task.Custome_Field_1__c}&
               00N9000000Dynxz={!Task.Custome_Field_2__c}&
               00N9000000DTHtF={!Task.Custom_Field_4__c}&
               opp10={!Task.Custome_Field_3__c}';

window.location.href = url;

User-added image

and this is my url

https://sf_instance.salesforce.com/006/e?ent=Opportunity&00N9000000Dynxu=Custom%20Val1&00N9000000Dynxz=Custom%20Val2&00N9000000DTHtF=Custom%20Val4&opp10=Custom%20Val3 (https://sf_instance.salesforce.com/006/e?ent=Opportunity&00N9000000Dynxu=Custom%20Val1&00N9000000Dynxz=Custom%20Val2&00N9000000DTHtF=Custom%20Val4&opp10=Custom%20Val3)
 
This was selected as the best answer
Art SmorodinArt Smorodin
Thanks Puneetsfdc,

noy sure why but it worked as a JS but stull does not work as a URL string.