-
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 5 years, 5 months ago by
Forcetalks.
-
This discussion was modified 5 years, 5 months ago by
Forcetalks.
-
This discussion was modified 5 years, 5 months ago by
Achintya.
-
This discussion was modified 5 years, 5 months ago by
Log In to reply.
Popular Salesforce Blogs

System.VisualforceException: Getting content from within triggers is currently not supported
System.VisualforceException: Getting content from within triggers is currently not supported (Salesforce Visualforce Error Notification) ---------------------------- Hi All, Recently I was working on a task in…

How to Freeze and Deactivate the User Account | Salesforce Developer Guide
Introduction Hello all, here we are going to learn about freezing the users accounts and deactivating the user account. Sometimes we need to delete some…

Begin With Big Objects in Salesforce | The Developer Guide
You, the quintessential Salesforce genius, thoroughly understand standard articles, custom items, and outer items. You thoroughly understand how these articles assist you with overseeing and…
Popular Salesforce Videos
15 Things You Didn’t Know About Salesforce
In this video we'll try to answer the following questions: What is Salesforce and why it is used? What is the job of Salesforce developer?…
Experience the Most Flexible, Easiest, and Securest Way to Integrate Salesforce and Jira
Integrate standard and custom Salesforce objects with Jira to strengthen cross-functional collaboration and deliver a top-notch customer experience. Fast-Track Your Journey to Attaining Customer Centricity…
Salesforce Einstein Prediction Builder and Einstein Next Best Action
Salaesforce Einstein Prediction Builder is a declarative tool that helps fast-track predictions based on Salesforce fields. This will help a Salesforce admin to custom-build predictions…