• pon-de-lion
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi,

 

Could anyone help me to find why i am getting getTargetObjectId=null though getTargetObjectId has value?

 

Please find the code to send mass email

 

messages.setTargetObjectIds(contactIds);

System.debug('contactids:'+contactIds);

System.debug('getTargetObjectIds:'+messages.getTargetObjectIds());

List<Messaging.SendEmailResult> resultList = Messaging.sendEmail(new Messaging.Massemailmessage[] { messages } , false);

 

 

Please find the debug log:

 

20091206092244.695:Class.SurveyCandidate.sendEmail: line 162, column 9: contactids:(003A0000003IfQ0IAK, 003A0000003IfQ1IAK)
20091206092244.695:Class.SurveyCandidate.sendEmail: line 164, column 9: getTargetObjectIds:(003A0000003IfQ0IAK, 003A0000003IfQ1IAK)
20091206092244.695:Class.SurveyCandidate.sendEmail: line 168, column 9: result:(Messaging.SendEmailResult[getErrors=(Messaging.SendEmailError[getTargetObjectId=null;]);isSuccess=false;])

 

 

Regards,

vin2sf

 

Message Edited by vin2sf on 12-06-2009 09:31 AM
  • December 06, 2009
  • Like
  • 0

Hi,

 

    our organization needs to display a list of related content for a product on a product page,

    we know there's a related content relationship in product objects where we can attach content

    manually, but there's no relationship exposed for this related list for us to pull the list whenever we

    want.

 

    does anyone have any idea how we might achieve the goal? so far we know custom coding is

    required, but we would like to confirm and see if there are other possible solutions. 

 

 thanks 

Hi,

 

Could anyone help me to find why i am getting getTargetObjectId=null though getTargetObjectId has value?

 

Please find the code to send mass email

 

messages.setTargetObjectIds(contactIds);

System.debug('contactids:'+contactIds);

System.debug('getTargetObjectIds:'+messages.getTargetObjectIds());

List<Messaging.SendEmailResult> resultList = Messaging.sendEmail(new Messaging.Massemailmessage[] { messages } , false);

 

 

Please find the debug log:

 

20091206092244.695:Class.SurveyCandidate.sendEmail: line 162, column 9: contactids:(003A0000003IfQ0IAK, 003A0000003IfQ1IAK)
20091206092244.695:Class.SurveyCandidate.sendEmail: line 164, column 9: getTargetObjectIds:(003A0000003IfQ0IAK, 003A0000003IfQ1IAK)
20091206092244.695:Class.SurveyCandidate.sendEmail: line 168, column 9: result:(Messaging.SendEmailResult[getErrors=(Messaging.SendEmailError[getTargetObjectId=null;]);isSuccess=false;])

 

 

Regards,

vin2sf

 

Message Edited by vin2sf on 12-06-2009 09:31 AM
  • December 06, 2009
  • Like
  • 0

My requirement is to send emails to multiple users. My apex works for contact and Lead object, but not for user object.sendEmail method executed successfully, but users are not reveing mails. Can anyone help why it is working for Contact/Lead but not for user