- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Site.com
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- Smart folks help me!! Can't pass custom object id ...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Smart folks help me!! Can't pass custom object id to Email template
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-24-2012 02:26 PM
Hi folk,
Hopefully you smart guys can help me out here. I have similar problem like you. I am trying to send an email from custom object with the related list. My custom object is 'Sample Tracking'
I created an email button on custom object with the following.
location.replace('/email/author/emailauthor.jsp?retURL=/{!Sample_Tracking__c.Id}&rtype=003&p2_lkid={! Sample_Tracking__c.Recipient_ContactId__c }&template_id=00XJ0000000QD59&p5=')
I created an email template with following:
<messaging:emailTemplate subject="Sample Tracking Products and Product Descriptions" recipientType="Contact" relatedToType="Sample_Tracking__c"> <messaging:HtmlEmailBody > <html> <body> <STYLE type="text/css"> TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center } TD {font-size: 11px; font-face: verdana } TABLE {border: solid #CCCCCC; border-width: 1} TR {border: solid #CCCCCC; border-width: 1} </STYLE> <font face="arial" size="2">
<p>Dear {!recipient.name},</p> <p>Below is a list of Products and Product Descriptions cases related to the Sample Request: {!relatedTo.Id}.</p> <p> {!relatedTo.Recipient_Contact__c}.</p> <table border="0" > <tr > <th>Product</th><th>Product description</th><th>Send Quantity</th><th>Cost</th> </tr> <apex:repeat var="cx" value="{!relatedTo.Product_Samples__r}"> <tr> <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> | <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></td> <td>{!cx.name}</td> </tr> </apex:repeat> </table> <P/> </font> </body> </html>
</messaging:htmlEmailBody> </messaging:emailTemplate>
The problem I am getting is, when i click the email button the sample tracking is is not passed to the email template. And the email template don't return anything. It loads properly with contact in 'to box' of email and subjects text comes properly but the particular sample tracking page from which I click the email button is not passed to the template. So none of the related lists shows up.
Please suggest. I have spend about a week with no solution. Appreciate your time.
Thanks
Swayam
Solved! Go to Solution.
Re: Smart folks help me!! Can't pass custom object id to Email template
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-25-2012 11:44 PM
Hi,
Use the below code for button:-
location.replace('/email/author/emailauthor.jsp?retURL=/{!Sample_Tracking__c.Id}&rtype=003&p2_lkid={! Sample_Tracking__c.Recipient_ContactId__c }&p3_lkid={!Sample_Tracking__c.Id}&template_id=00XJ0000000QD59&p5=')
If this solved your problem please mark it as answer.
Re: Smart folks help me!! Can't pass custom object id to Email template
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-27-2012 02:55 PM
Nope!! it doesn't like p3_lkid={!Sample_Tracking__c.Id}. I get the error as
The value of the "p3_lkid" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.
Thats becuase the Sample_tracking doesn't come in the dropdown list of " Related to" field as it is a custom object.
Any suggestion...
Re: Smart folks help me!! Can't pass custom object id to Email template
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-27-2012 10:11 PM
Go to create->object->Sample Tracking custom object's page . Check the Track Activites checkbox and then try.
If this solved your problem mark it as solved.
Re: Smart folks help me!! Can't pass custom object id to Email template
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-28-2012 10:16 AM
Dear Pathak,
I can 't say thank you enough. I have been struglling with this since last 2 weeks. Thanks you so very much.Looks like you have a good experience in salesforce.
Regards
Swayam

