-
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
Integrating Salesforce Service Cloud Voice with Amazon Connect: A Step-by-Step Guide
Many users of Salesforce Service Cloud are likely aware of the new AI-driven feature, Service Cloud Voice. Despite the rise of digital communication tools, telephone support remains…
7 Rules for a Better Salesforce Development
Salesforce ventures require arranging your application and at times creating code. To guarantee execution, practicality and stage limits, you have to do the correct design…
How to call Apex Method from Flow and Vice – Versa? | Salesforce Apex
Spring '23 features that align with your core admin responsibilities. Release Highlights for Admins Salesforce Admins drive innovation with four core responsibilities: User Management, Data…
Popular Salesforce Videos
Understanding Traditional AI vs. Generative AI | Explained Simply
Ever wondered how computers can be taught to think? Or how they create art, music, and stories on their own? If you're curious about these…
How relationship works in Salesforce?
In this video, following things have been explained: How to create relationships in Salesforce? What is the need of relationship between two objects in Salesforce?…
Design Patterns and Best Practices to Build Reusable Lightning Web Components | Salesforce Tutorial
LWC Best Practices & Design Pattern Component Architecture and Composition Styling Reusable components Sharing components between LWC and LWC OSS Packaging LWC and LWC OSS…