-
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
Don't Miss to Check Out The Top Salesforce Trends In 2022
Salesforce is taking its strength in cloud computing to a new level. It gained market share by making an easy to use and affordable software…
Chrome Extensions for Salesforce - A comprehensive review
Evgeny Azimzhanov works on the team at Aquiva Labs. They build customer-centric cloud apps on several platforms - especially Salesforce. Evgeny shares his experience trying…
LWC Interview Question – Part 2
Certainly! Here's a mix of Lightning Web Component (LWC) interview questions suitable for both freshers and experienced developers: What are the different types of data…
Popular Salesforce Videos
4 Benefits Of Customized Salesforce Services
Salesforce is a fantastic CRM, but the truth is that the off-the-shelf version is nothing compared to the power of Salesforce once you customize it.…
Salesforce Marketing Cloud Email Studio | Marketing Cloud Tutorial
Learn all about Salesforce marketing cloud email studio. In this video, the following points will be covered - 1. Overview Of Email Studio & Content…
Pros & Cons of Lightning Component vs. 3rd party frameworks in Salesforce UI development
Nikita drops by to share his invaluable experience of using popular 3rd party frameworks in Salesforce. http://media.blubrry.com/salesforceway/audio.xmcdn.com/group42/M05/25/57/wKgJ81rXk6XjaZIAAU_I_KtprFM998.m4a