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
BKBK 

S-CONTROL on Custom Object- Account lookup

Hello,
 
I have been working several hours trying to get this executed and can not get it to work.  I have downloaded the candidate object from the app exchange into Salesforce.  I created a lookup for contact so that when the new candiate button is clicked from the contact section, it brings over the contact name. However, I created a 2nd field for accounts with a lookup datatype.  When I create a new candiate from the contacts, it should automatically tie the contact AND the account associated with that contact(similar to how opportunties work). After a new candiate is created, I should see both company and contact on the candiate page in which I can reference back and forth to contact and account tabs. II tried creating an        s-control to override the new button for candiates but can not get to work. Need some help. Thank you
 
 
<script>
var accountName = "{!Account.Name}"
var contactName = "{!Contact.FirstName&" "&Contact.LastName}"
var contactId = "{!Contact.Id}"
window.top.location.href="/a0M/e?00N60000001Nv1L="+accountName+"&CF00N60000001NTUU="+contactName+ "&CF00N60000001NTUU_lkid="+contactId+"&nooverride=1"
</script>
michaelforcemichaelforce
You may have already tried this... but woudn't the account need to be defined in the same way you are defining contact?  That is, using the Id (not the name) and assigning it to the _lkid for that custom lookup field?
BKBK

Hi Michael,

The thing is, I can not see the code for the contact. I simply created a lookup and it automatically brought it over. I created another lookup for account but it needs to be in the new candidate butotn event when the buttone excutes at the contact level.Does the code format look correct?