+ Start a Discussion
DnyaneshwarDnyaneshwar 

custom button not passing values

Hello Everybody,

I have a custom object Raw_Lead__c with 3 custom fields namely: First_Name__c, Last_Name__c and Email__c . I have created a custom button on Raw_Lead object with URL:

/00Q/e?retURL=/{!Lead.Id}&{!Lead.FirstName}={!Raw_Lead__c.First_Name__c} & {!Lead.LastName}={!Raw_Lead__c.Last_Name__c}&{!Lead.Email}={!Raw_Lead__c.Email__c}&cancelURL=/{!Raw_Lead__c.Id}

I am trying to pass these 3 custom fields into lead fields.But when i click on the button of any Raw_Lead obj record it redirect me to Create page of Lead with all 3 lead values blank.
that times URL is :https://cs31.salesforce.com/00Q/e?retURL=/&=Ramesh%20&=rameshkend%40gmail.com&%20=Kendre&cancelURL=/a09p0000003jP5B
User-added image
User-added image
Can anyOne have any clue what am i doning wrong!
Best Answer chosen by Dnyaneshwar
DnyaneshwarDnyaneshwar
Hello All,

I figured it out what the problem was. [corrected URL] :

/00Q/e?retURL=/{!Lead.Id}&name_firstlea2={!Raw_Lead__c.First_Name__c}&name_lastlea2={!Raw_Lead__c.Last_Name__c}&lea11={!Raw_Lead__c.Email__c}&cancelURL=/{!Raw_Lead__c.Id}

Anybody facing such problem should look out for 2 things:
1) You have to assign the merger field value to id of the field and not its merge field (eg. id of Lead first name is name_firstlea2 )
2) Remove all white spaces from url .......its not a formula its a URL. And URL can;t have white spaces.

Regards
Dnyaneshwar K.

All Answers

ShamsiShamsi
write javascript, follow below link.
https://success.salesforce.com/answers?id=90630000000gwhCAAQ
DnyaneshwarDnyaneshwar
Hi Shamsi,

I tried the Javascript code in  link suggested by you. It creats Lead record with values populated but I Wanted to redirect to Edit page of lead with field values from Raw_Data__c object.

I would prefer the URL hacking way to achieve as it has option for returnURL and CancelURL.....Can any one help me figureout what is wrong in my URL hack logic as described above.

Thanks a ton!

 
DnyaneshwarDnyaneshwar
Hello All,

I figured it out what the problem was. [corrected URL] :

/00Q/e?retURL=/{!Lead.Id}&name_firstlea2={!Raw_Lead__c.First_Name__c}&name_lastlea2={!Raw_Lead__c.Last_Name__c}&lea11={!Raw_Lead__c.Email__c}&cancelURL=/{!Raw_Lead__c.Id}

Anybody facing such problem should look out for 2 things:
1) You have to assign the merger field value to id of the field and not its merge field (eg. id of Lead first name is name_firstlea2 )
2) Remove all white spaces from url .......its not a formula its a URL. And URL can;t have white spaces.

Regards
Dnyaneshwar K.
This was selected as the best answer