-
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
6 Ways to Improve Salesforce Release Management
Salesforce was initially planned as a CRM. Be that as it may, it's become a mainstream improvement stage because of its natural usefulness. Salesforce uses…
All You Need to Know About Queues in Salesforce
Case queues in Salesforce give your bolster organization a simple, adaptable arrangement to support and disseminate the cases over different levels of the organization. You'll…
Pushing Google Sheet data into the Salesforce database through G-Connector - Part 3
Hi All, Welcome Back to an another blog related to the G-Connector for Salesforce. In my first blog "G-Connector for Salesforce", I shared with you all…
Popular Salesforce Videos
Sharing Rules in Salesforce
Use sharing rules to extend sharing access to users in public groups, roles, or territories. Sharing rules allow administrators to automatically bypass organization-wide sharing settings.…
Alias Tags and Tracking in Salesforce Marketing Cloud
Cameron Robert from Datarati demonstrates how the Alias tag works in Salesforce Marketing Cloud, and how you can use it to improve your email tracking…
Reassign Leads using Lead Assignment Rule on Update/Upsert | Salesforce Tutorials | #SalesforceBolt
In this vlog, we will do some work around Assignment Rules. As you are aware Assignment Rule can be trigger on Insert actions. Either it…