You need to sign in to do that
Don't have an account?
Sapamrm
Custom "send email"-button with record creator as default recipient
I've created a custom object "Commercial Agreements".
When creating a new email from the Activity History related list "send email"-button, I would like the recipient ("To") to have a default value, the (commercial agreement) record creator.
Code of the standard "send email"-button is:
with 0013000000dLWUx = Account ID
and a063000000CJweX = Commercial agreement record ID
How should I adapt the code for my custom button so that the record creator is automatically filled in in the "To"-field?
What is the code/ID for that "To"-field?
Thanks in advance!
hi Sapamrm,
Please refer to this thread HERE
You can select a default template too and add additional receipients.
This is a work around but should be helpful.
--VK
Think its p2_lkid that you're looking for. Set that to the Salesforce Id of the Recipient.
I've found this Web Developer add-in for firefox very handy to be able to pull out html ids of elements for this type of operation.
http://chrispederick.com/work/web-developer/
After installing this, you will see a toolbar display in firefox. Hit Forms -> Display Form Details, and lo voila, you can quickly copy any id's you may need.
Hi!
Thx for the replies!
I tried adding the following to the button code: &p2_lkid={!Commercial_Agreement__c.CreatedById}, but this did not work.
Even when I tried with a direct contact ID: &p2_lkid="0033000000hHHHS" the contact name was not filled in in the "To"-field..
hi,
i think u are using the Standard field 'Created By'
try using a custom field and it should work.
--VK
It can't be p2_lkid.
I just noticed that this field is already used to to pass the account ID.
Code I have so far:
Hi Sapamrm,
Please try this code exactly as it is changing the custom email fields and template id.
location.replace('_ui/core/email/author/EmailAuthor?p2_lkid={!Commercial_Agreement__c.My_Cutom_To_EmailField__c}&rtype=003&p3_lkid={!Commercial_Agreement__c.Id}
&rtype=003&p24={!Commercial_Agreement__c.My_Custom_AdditionalToEmail__c}&retURL=/{!Commercial_Agreement__c.Id}&template_id=00XA0000000Dv41')
-- VK