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
Ben4817Ben4817 

Trying to use Contact ID from a Person Account

I am trying to write some simple s-controls to override standard buttons.  In my contract, I have added a field for a Contact.  When I am creating a contract from a Person Account, I want to be able to set the Contact through the URL.  I can do a report and see the Contact ID for the Person Account, and I know the field to which it needs to map, but I can't get the field name to be able to assign it.  Does anyone know what to use?  I have tried {!Account.PersonContactId}, {!Account.ContactId}, etc. to no avail.  Thanks in advance!
werewolfwerewolf
I'm not entirely sure you'll be able to get that through a merge field (although in theory {!Account.PersonContactId} should have worked).  Does it throw up on you if you try to give it the account ID in that field?  It probably will, but it might work...
Ben4817Ben4817
Sorry about the cross posting - I put it in the other thread and then realized that was incorrect.  I tried both using the Account.Id into that field and the Account.PersonContactId, but neither worked.  It just doesn't pull anything up.  I've scoured all of the documentation I can find, but nothing gives the merge field to access that ID.  Is there a way to view the code for sending an email?  I noticed that the contact ID is used when sending an email.  Thanks.
Ben4817Ben4817
I got it to work.  In the end, your suggestion was the key - I passed in the Account.Id to the Id field, and just had to also pass the Account.Name to the name field and then it worked fine.  Somehow, it knew which Id to take over when it needed to be the Contact Id from the Person Account.  Not very intuitive, but at least it worked!
Ben4817Ben4817
I guess not.  I tested this further, and while it looks like it works, it won't let you save the new record.  After analyzing it closer, I found out that it still brings over the Account.Id, so I stuck with the same problem of trying to access the Contact.Id.  Is the code for the Send An Email button posted or accessible anywhere?
werewolfwerewolf
There's not really any visible code for the Send An Email button -- the URL is the only code you'll be able to see.
werewolfwerewolf
Actually this works fine for me:

/email/author/emailauthor.jsp?retURL=/{!Account.Id}&p3_lkid={!Account.Id}&rtype=003&p2_lkid={!Account.Id}&nooverride=1

You just have to make sure your person account actually has a valid email address in there.