+ Start a Discussion
kram322kram322 

URL Hack: Populating a Custom object with a Contacts "Account Name"

Hello!

I've searched around and cannot find where I'm going wrong with this. I've created a custom list new button for a custom object Associations. This button is attached to the Associations related list on the Contact record page. 

I need to populate the new Associations record with field values from the Contact record, I'm running into difficulty passing the contacts "Account Name" value into the new field. I get the error message "Field Contact.Account.Name does not exist".

This is the URL i'm attempting to pass, the other fields populate fine, just the account name seems to allude me:

/a0A/e?CF00N200000064Q30={!Contact.Name}
&CF00N200000064Q30_lkid={!Contact.Id}
&CF00N20000006TR7J={!Contact.Account.Name}
&CF00N20000006TR7J_lkid={!Contact.Account.Id}
&00N20000006cmWu={!Contact.Title}
&retURL=/{!Contact.Id}

I've tried passing it numerous ways attaching __r etc. Either I'm missing something blindingly obvious or this isn't possible?

 

Help is very much appreciated!

Best Answer chosen by kram322
hitesh90hitesh90
Hello Kram,

you have to use Account.Name instead of contact.Account.Name directly. see below.
/a0A/e?CF00N200000064Q30={!Contact.Name}
&CF00N200000064Q30_lkid={!Contact.Id}
&CF00N20000006TR7J={!Account.Name}
&CF00N20000006TR7J_lkid={!Account.Id}
&00N20000006cmWu={!Contact.Title}
&retURL=/{!Contact.Id}

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
Email :- hiteshpatel.aspl@gmail.com
My Blog:- http://mrjavascript.blogspot.in/

All Answers

Vamsi KrishnaVamsi Krishna
did you try passing {!Contact.Account} as the value ..

/a0A/e?CF00N200000064Q30={!Contact.Name}
&CF00N200000064Q30_lkid={!Contact.Id}
&CF00N20000006TR7J={!Contact.Account}
&CF00N20000006TR7J_lkid={!Contact.AccountId}
&00N20000006cmWu={!Contact.Title}
&retURL=/{!Contact.Id}
kram322kram322
Yup tried that too, same error "Field Contact.Account does not exist. Check spelling."
hitesh90hitesh90
Hello Kram,

you have to use Account.Name instead of contact.Account.Name directly. see below.
/a0A/e?CF00N200000064Q30={!Contact.Name}
&CF00N200000064Q30_lkid={!Contact.Id}
&CF00N20000006TR7J={!Account.Name}
&CF00N20000006TR7J_lkid={!Account.Id}
&00N20000006cmWu={!Contact.Title}
&retURL=/{!Contact.Id}

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
Email :- hiteshpatel.aspl@gmail.com
My Blog:- http://mrjavascript.blogspot.in/
This was selected as the best answer
kram322kram322
Hitesh,

I tried that earlier but gave it one more shot and it worked! Must have made an error somewhere.

Thank you for your help!
Hamsa RajHamsa Raj
Hello

I'm not a developer. I need to populate the contact information in to a custom object I have created. I have this object as a related list in the contact page. The WF rule I have shoes the populated fields only after I save the record. To avoid any confusion for the end users, I want the contact details to show as they are in the edit mode in custom object.

How do I go about using this code to create a button in an object?

Regards
Hamsa