-
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
Basic Knowledge Of Artificial Intelligence (feat. Salesforce Einstein)
Artificial Intelligence (AI) is a mechanism for a machine to “think like humans” — i.e., the machine can perform tasks with the planning, reasoning, learning,…
Salesforce Service Cloud and Jira Integration: What to Expect from an Optimum Connector?
89% of business buyers say they expect companies to understand their unique needs and expectations. From personalized marketing journeys to providing top-notch service experience and…
Salesforce Interview Questions You Need to Know in 2024
Here are some potential line-based Salesforce interview questions that you could include in a blog post: Interview Questions to Crack your Next Interview 1. What…
Popular Salesforce Videos
Drive Personalized and Scalable Idea Management in Salesforce Community Cloud with IdeasPro
IdeasPro enables you to implement the best of business ideas from your Salesforce community. Foster innovation, improve brand transparency, and make the most of internal…
What are Queues in Salesforce? | How to create queues and assign records to it in Salesforce?
This video explains Queues in Salesforce by dividing this topic into 5 basic points, which are: 1. What purpose do queues solve? 2. What are…
12 Highlights of Salesforce Summer’22 Release That You Can’t Miss
The Salesforce Summer '22 release is quickly approaching. We know there are many exciting features coming our way. From the 6th and 7th of May,…