-
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 5 years, 7 months ago by
Forcetalks.
-
This discussion was modified 5 years, 7 months ago by
Forcetalks.
-
This discussion was modified 5 years, 7 months ago by
Achintya.
-
This discussion was modified 5 years, 7 months ago by
Log In to reply.
Popular Salesforce Blogs

Managing Product Bundles Effectively with Salesforce CPQ
Salesforce has revolutionized itself in the last 20 years from being one of the SaaS-based products to one of the most preferred and Industry-standard CRM…

All You Need to Know to Make a Scratch Org and Your Domain
How to Make your Domain? Change the domain of dev org to my domain: To change the domain, you first have to create your domain.…

Best Practices For a Well Managed Knowledge Base In Salesforce
Generation Z doesn't like to rely on customer care representatives for assistance. Independence and self-sufficiency are important for them. As a result, self-service has gained…
Popular Salesforce Videos
Salesforce Development and Career Opportunities
Salesforce is the world’s #1 customer relationship management (CRM) platform. Salesforce allows sales reps to see everything about a customer in one place and provide…
Salesforce Development Course for Intermediate Developers
If you want to become a Salesforce developer in 2021 then watch this video, here you'll learn about some of the best Salesforce Development Course…
How Does SFCC (Headless Commerce) Different From Its Competitors and Why Is It Better? | Salesforce
Let's have look at which one is better SFCC, Shopify, Magento, or Woocommerce. Which one you should choose? Have a glance at this extract from…