You need to sign in to do that
Don't have an account?
Anand@SAAS
Visualforce Email template + INVALID CROSS REFERENCE
Anyone know if VF Email templates run as "With Sharing"? I have a VF template that sends emails to contacts ie. recipientType="Contact"
I use Apex Email to send the email and set the "Target Object Ids" to the Contact Ids. However I get an "System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []".
Contact is "Public
Well this error comes when you are assigning wrong ID to any object.I have also encountered this error few times. :)
for eg. when you have lookup to contact object. so you are assigning some Id to contact which doesn't exist or is referenced to some other object. Then it might throw an error.
I guess in this case you might be setting wrong target object Id to contacts.