-
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 To Plan For A Successful Salesforce Data Migration?
This blog on data migration planning features a brief into towards data migration planning process then it focuses on common data migration issues, the extension…
How to Select a Certified Salesforce Consultant?
Cloud computing was always there in one form or another, but it has started to really develop in the past half-decade or so. Salesforce is…
Why You Should Hire Salesforce Consultant for Your Business Process?
Be it a small business or a big enterprise, with the guidance of the best Salesforce consulting services, organizations can achieve greater goals with utmost…
Popular Salesforce Videos
How to Report on the Reports in Your Salesforce Org
Do you want a list of all the reports in your Salesforce org? Would you like to see a list of reports and the last…
Salesforce Development Tutorial - sObjects
It is very easy to learn Salesforce with the world class training tutorial. Training is key for the right knowledge. Those who work as an…
Getting Information from your Salesforce Account for a Salesforce Connection
Watch this video to learn how to get information from your Salesforce Account for a Salesforce Connection. Do let us know in the comment section…