function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Irvine DelacroixIrvine Delacroix 

Apex Trigger on Notes and Attachment (How to create Test and Deploy it)

Hey guys,

Need help please. How do you create a test class if your trigger is on Notes and Attachments?

Through the use of Force.com Developer Console, I've created a Test Field update (I'm gonna use the field update for my email alert.. If there is new attachment to the record, then it will fire an Email Alert notification).

Can I have a suggestion please? I am very new to Apex coding..

Thanks a lot!

Regards,

vinzell999
PratikPratik (Salesforce Developers) 
Hi,

Here is tha sample code that you can refer to to write a test class for attachment:
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008yzKIAQ

Thanks,
Pratik

P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.