-
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
Rev Up Your Business With Top 10 Free Apps On Salesforce AppExchange
Do you know many apps on the Salesforce AppExchange can assist in streamlining your operation and boosting your bottom line without any additional cost? Installing…
How to Evaluate Multiple Conditions in "aura:if" tag in Salesforce Lightning ?
aura: if tag - Aura:if tag renders the content either in its body or in the else attribute based on the value of the isTrue…
Salesforce Flows - What You Need to Know
Businesses strive to grow bigger and better, but the amount of complex processes becomes trickier to manage without a reliable system that can streamline multiple…
Popular Salesforce Videos
Salesforce Tutorial - How to Create Custom App in Salesforce
Apps, Tabs, Objects are basic Building Blocks of Salesforce. In this video, I am explaining how exactly you will able to develop a custom app…
Salesforce DX simplified with AutoRABIT - Bay Area Salesforce Developer Group
A common need that teams developing on the Salesforce platform express is the desire for a single solution that will take their developers through the…
Tips on Lightning Combo Box, Events in Lightning App Builder, and More
Watch this video by Salesforce Developers to get the tips on Lightning Combo Box, Events in Lightning App Builder, and more. Watch and learn, do…