-
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 6 years, 3 months ago by
Forcetalks.
-
This discussion was modified 6 years, 3 months ago by
Forcetalks.
-
This discussion was modified 6 years, 3 months ago by
Achintya.
-
This discussion was modified 6 years, 3 months ago by
Log In to reply.
Popular Salesforce Blogs
Granting Log-in Access Into Your Salesforce Org With Limited Access To Salesforce AppExchange App Provider
Hi folks, Today we will learn, how to give grant access to Salesforce AppExchange App provider? There are many people who don't know how to…
Salesforce Spring Release ‘24: Features Overview
As you know, Salesforce releases updates three times a year, adding features for developers and making improvements or innovations to Salesforce. The innovations vary, for…
Typical Stages of Salesforce Integration
The full version was originally published at Twistellar Delivering a seamless customer experience is a key element fuelling your business growth. Providing this kind of…
Popular Salesforce Videos
Custom Button URL Hacking in Salesforce Lightning Experience vs Salesforce Classic
Custom Button URL Hacking in Salesforce Lightning Experience vs Salesforce Classic Custom button URL Hacking approach in Salesforce Classic Custom button URL Hacking approach in…
What is Lightning Web Components (LWC) in Salesforce?
LWC is a collection of modern framework which has lightweight features and we can create a reusable code. Watch this video and let us know…
What is Salesforce | Salesforce CRM Tutorial For Beginners | Salesforce Training
This Salesforce Training Video will help you understand what is a CRM ( Customer Relationship Management ), why we need Salesforce CRM and how some…