-
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, 1 month ago by
Forcetalks.
-
This discussion was modified 7 years, 1 month ago by
Forcetalks.
-
This discussion was modified 7 years, 1 month ago by
Achintya.
-
This discussion was modified 7 years, 1 month ago by
Log In to reply.
Popular Salesforce Blogs
7 Reasons You Should Consider Salesforce CTI Integration
Salesforce CTI integration is the process of integrating your Salesforce account with your customer relationship management (CRM) system. This allows you to manage your customer…
How to Set Up Web-to-Lead in Salesforce | The Complete Guide
What is Salesforce Web to Lead Salesforce web to lead is a tool for capturing and saving leads from your website. Salesforce has this capability…
Popular Salesforce Videos
Get Started with Salesforce for Recruitment and Admissions: Recruitment and Marketing
This webinar is designed for Salesforce admins and users who work in Recruitment and Admissions. It covers all you need to know about using Salesforce…
Salesforce India Engineer Salary Revealed | Salary Break Up | Company Review
In this video, Soumyajit Bhattacharyay has given a detailed review of Salesforce. Talked about the tech stack that they work in. Talked about their offices…
Salesforce Marketing Cloud Connect Complete Setup in Lightning
Cameron Robert demonstrates a complete end-to-end setup of Marketing Cloud Connect in Lightning view. Marketing Cloud Connect creates an integration between Salesforce CRM and Salesforce…