-
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
What Are the Key Qualities to Look for When Hiring Salesforce Consultants in India?
In the dynamic landscape of business, Salesforce has emerged as a pivotal platform for companies seeking to streamline their operations, enhance customer relationships, and drive…
Introduction To Workbench In Salesforce
Workbench is a web tool used to interact with Salesforce organizations via API (Application programming interface). You can use Workbench to explore, inspect, edit, migrate…
Develop in Production: Insane or Inspired?
Accelerating implementation We all know the benefits of accelerating and streamlining the release cycle; the business is more agile and reduced development effort. But there…
Popular Salesforce Videos
Salesforce Field Service Scheduling Optimization | AblyPro Webinar
Revolutionize and Level Up Your Game in Services Business With Field Service With Salesforce Field Service on your side, businesses can reduce travel time, improve…
What is Headless Commerce? | Salesforce Commerce Cloud
Brands need to keep up with this change and require a certain level of agility and nimbleness. This is where Headless Commerce is a game…
Salesforce Careers - Why Consider A Career In Salesforce
This Salesforce Training Video will help you understand about Salesforce, Salesforce market situation, Salesforce job trends, Salesforce career options and how Salesforce is a safe…