-
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, 7 months ago by
Forcetalks.
-
This discussion was modified 6 years, 7 months ago by
Forcetalks.
-
This discussion was modified 6 years, 7 months ago by
Achintya.
-
This discussion was modified 6 years, 7 months ago by
Log In to reply.
Popular Salesforce Blogs
Salesforce + LinkedIn Sales Navigator - Maximizing Sales Efficiency
In today's competitive business landscape, integrating Salesforce and LinkedIn Sales Navigator is paramount. This powerful synergy brings forth enhanced lead generation and streamlined sales processes.…
AWS Cloud Basics | Salesforce Trailhead Guide
In this blog, we will be taking a look at the topic of AWS Cloud. As we all know Cloud computing is the on-demand provision…
Your Salesforce Implementation Guide
Early-stage startups, mid-sized companies, large enterprises — no matter your size, you can only ignore the importance of implementing a Salesforce solution for so long.…
Popular Salesforce Videos
Getting started with salesforce
Salesforce is a customer relationship management solution that brings companies and customers together. It's one integrated CRM platform that gives all your departments — including…
How to Connect Salesforce Billing Payment Gateways (COMPILATION)
In this compilation, we’ll show you what you need to know about using your preferred payment gateway with Salesforce Billing + CPQ - like how…
Adding an Email Service Channel with Email-to-Case | Salesforce Tutorial
Learn how to add an email service channel with Email-to-Case. This feature will enable you to resolve and correspond with customer inquiries via email without…