-
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

B2B Commerce Cloud Summer’24 Release
Salesforce's B2B Commerce Cloud Summer ’24 release is here, bringing a variety of new features designed to improve customer experience and make business operations more…

Benefits of Salesforce Integration for Educational Institutions
Educational institutions are aggressively embracing run-of-the-mill Customer Relationship Management (CRM) systems amidst data and technology-dominated times to - execute a productive workflow, maximize communication, and…
Popular Salesforce Videos
Customize Salesforce Lightning Home page
In this video Signiforce shows : How to customize the Salesforce Lightning Home page. Update an existing Salesforce lightning home page or create a new…
How to Find Job as a Fresher in Salesforce - Tips and Tricks
In this video Rohit Puri gives a detailed explanation of the questions that everyone has regarding Salesforce jobs, how to find jobs in Salesforce on…
Salesforce Training Videos For Beginners - 3 | Salesforce Admin Training
This Salesforce Training Video will help us in quotation generation and improve customer communication. Generating proposals can be a drag on sales team productivity. Editing…