-
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, 2 months ago by Forcetalks.
- This discussion was modified 5 years, 2 months ago by Forcetalks.
- This discussion was modified 5 years, 2 months ago by Achintya.
Log In to reply.
Popular Salesforce Blogs
The DreamPlace For ISVs – Salesforce AppExchange
To sustain in this competitive market, independent software vendors (ISVs) must get their products behave and respond in the fastest of fashion. ISVs are turning…
Salesforce Service Cloud Welcomes Einstein AI, Ropes In Quip As Well
A new era of Salesforce Service Cloud is underway with a bunch of Einstein AI capabilities incorporated into the product. The upcoming AI-leveraged Salesforce Service…
Popular Salesforce Videos
Enhance Not Divest your Investment in Salesforce
Here in a short Video Blog, Ian Moyse, Natterbox Sales Director and Sales Director of the year winner (Institute of Sales Management) talks to how…
Salesforce Einstein Discovery Spring 21
Einstein Discovery is AI-powered analytics that enables business users to automatically discover relevant patterns based on their data – without having to build sophisticated data…
Security in Salesforce | Learn About the Security Levels in Salesforce
This "𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐢𝐧 𝐒𝐚𝐥𝐞𝐬𝐟𝐨𝐫𝐜𝐞" video by Edureka will help you understand the different levels of security in Salesforce. It will also talk about some of…