-
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, 5 months ago by
Forcetalks.
-
This discussion was modified 6 years, 5 months ago by
Forcetalks.
-
This discussion was modified 6 years, 5 months ago by
Achintya.
-
This discussion was modified 6 years, 5 months ago by
Log In to reply.
Popular Salesforce Blogs
Best Practices for Salesforce Integration: Streamlining and Optimizing Your Workflow
Salesforce integration plays a crucial role in connecting your org with other systems, streamlining workflows, and enabling data-driven decision-making. To ensure successful integration, it’s essential…
Download and Installation of Ant Migration Tool | Salesforce Developer Guide
Introduction The Ant Migration Tool is a Java/Ant-based command-line utility for moving metadata between a local directory and a Salesforce org. Usage of Ant-migration Tool …
Salesforce Managed vs. Professional Services: Which One is Right for Your Business?
Salesforce provides a range of services to help organizations optimize their CRM capabilities. When it comes to leveraging the power of Salesforce, organizations often navigate…
Popular Salesforce Videos
How To Create A Case Assignment Rule In Salesforce
Learn all about how to create Case Assignment rules. In this video, the following points will be covered - 1. Introduction To Case Assignment Rule…
The Rise of Salesforce
Salesforce is a cloud computing service as a software (SaaS) company that specializes in customer relationship management (CRM). Salesforce's services allow businesses to use cloud…
Lightning Component Development - 01 - Basic of Lightning Framework, Component Bundle, App Builder
What is covered in this session? * What is Lightning Component Framework? * Lightning Component Across Salesforce Ecosystem * When to use lightning component? * Where…