-
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
Keys to Improve Salesforce DevOps Efficiency
As indicated by the State of Modern Applications in Enterprises Report 2020, just 37% of big business respondents are happy with how quickly they are…
Salesforce Financial Services Cloud | Empower your borrowers with Mortgage Innovation
Loans and Mortgages are key elements of today’s economy and there is a likelihood that every adult at some time or other has been part…
Saving Journey History in Salesforce Marketing Cloud
Salesforce Marketing Cloud allows you to set your contacts on a marketing journey with timed communications and logic-based actions. It also gives you the ability…
Popular Salesforce Videos
Happy 2021 to the Salesforce Ohana
As 2020 comes to a close, the challenges of the past year give way to hopes of a new year full of love, cheer, &…
Salesforce Admin training : How to create a custom app in Salesforce?
In this tutorial, you will learn to create a custom app in Salesforce and go through a quick overview of Profiles. Profiles control the visibility of your…
Introduction to Salesforce Flow Builder
Watch this video to learn about Salesforce Flow Builder. 0:00 Introduction 2:50 Introduction to Salesforce Flows 4:40 Types of flows, Screen, Auto-Launched 7:10 Components related…