-
Test class of below Trigger in Salesforce?
Trigger AutoActivityCreation on Account(after update) { List<Task> task = new List<Task>(); for (Integer i = 0; i < Trigger.new.size(); i++) { List<String> techs = Trigger.new[i].Toolsberry_new_tech_installs__c.split(‘;’); Integer added_tech = techs.size(); if(Trigger.new[i].Toolsberry_new_tech_installs__c==’null’){ added_tech=0; } List<String> re_techs = Trigger.new[i].Toolsberry_removed_tech_installs__c.split(‘;’); Integer removed_tech = re_techs.size(); if(Trigger.new[i].Toolsberry_removed_tech_installs__c==’null’){ removed_tech=0; } task.add(new Task( whatid=Trigger.new[i].Id, OwnerId=Trigger.new[i].OwnerId, Subject=’Technologies Added ‘+added_tech+’ , Removed ‘+removed_tech, Status = ‘Completed’, ActivityDate = system.today() ) ) ; } insert task; }-
This discussion was modified 7 years ago by
Forcetalks.
-
This discussion was modified 7 years ago by
Forcetalks.
-
This discussion was modified 7 years ago by
Achintya.
-
This discussion was modified 7 years ago by
Log In to reply.
Popular Salesforce Blogs
Salesforce Commerce Cloud - The Gateway to B2B eCommerce Success
The B2B eCommerce industry is constantly changing. These changes are more profound and permanent than any that occurred in the past, given the recent developments…
How to Digitize Pharmaceutical Production with Salesforce
Following the pandemic, the pharmaceutical industry has been expanding and the companies are competing with each other, struggling to take a lead in the market.…
Triggers in Salesforce - All You Need to Know
Trigger A trigger is a piece of code that runs before and after a record in the force.com database is inserted, updated, or deleted. Triggers…
Popular Salesforce Videos
What is Headless Commerce? | Salesforce Commerce Cloud
Brands need to keep up with this change and require a certain level of agility and nimbleness. This is where Headless Commerce is a game…
What is Salesforce Development? | Salesforce Developer Course
In this video, Shrey has given a detailed overview of the Salesforce Development Course. You will learn the following topics from this course: Apex basics…
70 Salesforce Interview Questions for the Beginners
First of all, How it is different from the other Salesforce Interview questions videos? Well, We have divided the questions into categories so that you…