+ Start a Discussion

issue with 'case' trigger-Invalid field?

I'm getting an Error: Compile Error: Invalid field contactemail for SObject Case at line 4 column 10

which is strange to me since Contact Email {contactemail} is a listed field in 'cases'. In fact almost none of the case fields are considered valid...

I tried writing a sample trigger for 'accounts' and had no problems since all the fields were available. Oddly enough the only field that seems 'readable' is Web Email {suppliedemail}


trigger trigCase on Case (after insert)


    for(case c:trigger.new)


       string e=c.contactemail;




Any help/clues would be appreciated.



      There is no contactemail field in case object.its a lookup relationship with contact object.

You can use contact.Email rather than contactemail.To more explore about case fields you can go with eclipse IDE.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.