-
What is wrong in my Salesforce Trigger Test Class which updates IsUnreadbyOwner field to False?
I have written a simple Salesforce Trigger. I want to update the IsUnreadbyOwner field to False once a lead becomes unqualified.
My Trigger is:
trigger UnqualifiedLead on Lead (after update) { for(Lead lead: Trigger.new) { if (lead.Status == ‘Unqualified’) { lead.IsUnreadByOwner = False; } } }My Test class is:
@isTest private class UnqualifiedLeadTest { static testMethod void myUnitTest() { // Setup the lead record Lead lead = new Lead(); lead.LastName = ‘last’; lead.FirstName = ‘First’; lead.Company = ‘Company’; lead.Status = ‘Unqualified’; lead.IsUnreadByOwner = True; insert lead; } }
Log In to reply.
Popular Salesforce Blogs
Understanding Salesforce: Empowering Businesses with Cutting-Edge CRM Solutions
In the rapidly evolving landscape of modern business, customer relationships are paramount. Maintaining seamless interactions, personalized experiences, and efficient processes are essential to success. This…
URL Hacking in Salesforce - Episode 3
HEY!!! Welcome back, previously in URL Hacking Episode 2, we see how to make possible and working of the pre-populated field values via a custom…
Supercharge Support Agents with These Lesser-Known Salesforce Service Cloud Features
We are living in a time when customer experience matters the most for a business. A disappointed customer will take no longer a minute to…
Popular Salesforce Videos
Dynamic Action in Salesforce | Salesforce Tutorial
In this video, we are going to talk all about dynamic actions in Salesforce. 00:00 Introduction 00:57 Work with Dynamic Action 05:05 Dynamic Actions in…
Explore Our Salesforce Story
Explore the origins of Salesforce and how the Futureforce program came to be. Watch this video and do connect with us and share your experience…
Salesforce enthusiasts welcomes you to the Trailhead! Skill up for the future.
A trailhead is defined as an outdoor space that is designated by an entity responsible for administering or maintaining a trail to serve as an…