-
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
How Salesforce Can Benefit Real Estate Business?
As a real estate agent, your primary goal is to close deals quickly while providing outstanding customer service. However, with a never-ending stream of leads…
Why Does an Online Retail Business Need Salesforce Commerce Cloud?
The e-commerce industry is revolutionizing the way buyers shop. With time more and more people are inclined to brands that sell online or have a…
Efficient Salesforce Documentation with Data Dictionaries in 2024
In the dynamic world of Salesforce, the management and understanding of metadata plays a crucial role in maintaining robust business processes. For teams working within…
Popular Salesforce Videos
How to Learn Salesforce Fast? Explained.
How to learn Salesforce in six months and get your first job in the industry. Learning Salesforce these days is challenging because the platform is…
How Salesforce Industries can be Used on Top of Salesforce?
Salesforce Industries offers pre-built solutions on the Salesforce platform that solve the needs of particular industries. Vlocity takes these common requirements and packages them into…
How To Create A Case Assignment Rule In Salesforce
Learn all about how to create Case Assignment rules. In this video, the following points will be covered - 1. Introduction To Case Assignment Rule…