0

Hello friends Firstly i create to button for SendMail and i want to get Case.Owner.Name in my array, i try i can get another fields data in my array, when i try to get Case.Owner i taking error message

ErrorMessage: Error: Field Case.Owner.Name does not exist. Check spelling.

   {!REQUIRESCRIPT ('soap/ajax/29.0/connection.js')} 
   {!REQUIRESCRIPT('/soap/ajax/29.0/apex.js')}






   var result= sforce.connection.login("----","----");

sforce.connection.sessionId = result.sessionId;

var caseObj = new sforce.SObject("Case");

caseObj.Id = "{!Case.Id}";

var myrecords = sforce.connection.query("select email from contact where Id = '0031t00000BrpLp'");

var records = myrecords.getArray("records");

for(var i=0; i < records.length ; i++)
{
   console.log(records[i].Email);
}

var ArrayCaseData = new Array();
ArrayCaseData = "CaseOwner {!Case.Owner}";-----> Here Not working Lookup(User,Queue)
ArrayCaseData = "CaseAsset {!Case.Asset}";-----> Here Working Lookup(Asset)
console.log(ArrayCaseData);

/*
var singleRequest = new sforce.SingleEmailMessage();
singleRequest.replyTo = "-----";
singleRequest.subject = "Test";
singleRequest.plainTextBody = "Test!";
singleRequest.toAddresses = ["---"];
*/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.