-
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, 2 months ago by
Forcetalks.
-
This discussion was modified 7 years, 2 months ago by
Forcetalks.
-
This discussion was modified 7 years, 2 months ago by
Achintya.
-
This discussion was modified 7 years, 2 months ago by
Log In to reply.
Popular Salesforce Blogs
Learn All About Visualforce in Salesforce - The Complete Guide
Introduction With the help of the web development framework Visualforce, programmers may create complex, unique user interfaces for desktop and mobile apps that can be…
Test Class in Salesforce - All You Need To Know
Below are some of the key points to note about the Test Class in Salesforce: Test Classes and test methods verify whether a particular piece…
Top Salesforce Winter '23 Flow Features
In our next blog, we spoke about the Top 10 Salesforce Winter ‘23 release features. However, we cannot miss the most important Salesforce Flow features.…
Popular Salesforce Videos
Salesforce on Salesforce: How Salesforce Uses Trailhead to Drive Enablement
With Trailhead, Salesforce is transforming the learning experience for our employees at every step of their career journey. Join us to learn tips, tricks and…
Case Study: Connecting Ferries with Salesforce IoT Explorer
The data that Salesforce IoT Explorer brings to the table helps businesses take real-time business decisions that translates into better customer service. Salesforce, in its…
5 Salesforce Developer Interview Red Flags That’ll Likely Get You Rejected
These are some common interview red flags that’ll likely get you rejected for that dream Salesforce developer job. Start prepping accordingly! Watch this video and…