You need to sign in to do that
Don't have an account?
moeoo
Populate Custom object's fields to template
Hi
I'm trying to populate the custom object fields to template.
I can populate the contact fields to template before I send email.
This is the code I used for Contact but how can I get field values from Custom object.
var accountid = "{!Account.Id}";
queryResponse = sforce.connection.query("select id, Email from contact where AccountID = '" + accountid + "'");
records = queryResponse.getArray("records");
var contactID = records[0].Id;
var contactEmail = records[0].Email;
//alert(contactID);
records = queryResponse.getArray("records");
var contactID = records[0].Id;
var contactEmail = records[0].Email;
//alert(contactID);
var massRequest= new sforce.MassEmailMessage();
var ids = new Array();
ids[0] = contactID;
massRequest.targetObjectIds = ids;
//alert(massRequest.targetObjectIds);
massRequest.subject = "test";
massRequest.replyTo = user;
massRequest.templateId = templatedId ;
try
{
var sendMailRes = sforce.connection.sendEmail([massRequest]);
alert('Email sent to user id: ' + contactEmail);
var ids = new Array();
ids[0] = contactID;
massRequest.targetObjectIds = ids;
//alert(massRequest.targetObjectIds);
massRequest.subject = "test";
massRequest.replyTo = user;
massRequest.templateId = templatedId ;
try
{
var sendMailRes = sforce.connection.sendEmail([massRequest]);
alert('Email sent to user id: ' + contactEmail);
}
catch(err) {
alert(err)
}
catch(err) {
alert(err)
}
I can get the Id of my Custom object but it didn't populate the values. Can I use custom objects here?
If you have found an answer of the question.. you had raised above.. please revert...