-
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
Specific Differences In Salesforce
WhoId Vs WhatId WhoId WhatId WhoId represents the person type things. WhatId represents object type things. LeadId and ContactId are categorized under the whoId. WhatId…
Unboxing Salesforce Winter ’20 edition| Accelerate the adoption with Salesforce In-App guidance
Along with numerous global events taking place this winter, Salesforce has also released its much-awaited Winter ’20 edition. And, as always, Salesforce has exceeded the…
How to Get 8 Salesforce Certificates in Less Than a Year?
I believe that for a Salesforce developer there is nothing more important than the practice of working on different projects, with different stacks We asked…
Popular Salesforce Videos
How to Get a Mentor? | Salesforce Learning | The Shrey Sharma Show
Looking for a mentor for Salesforce Learning? Watch this video to learn how to find one. Watch the full Video: https://youtu.be/6oi2zdJCFhs Check out the book:…
How does Salesforce Field Service Platform increase servicing revenue for your company
CRM Salesforce, along with its Field Service Lightning App, is drastically improving the field-force productivity in the industry. Built on the Salesforce Service Cloud, it…
Transition to Salesforce Lightning Experience
Transition to Salesforce Lightning Experience for Overall Navigation, Global Search, Home Page, Accounts, Leads and Opportunities. This video walks you through the recommended process, including…