-
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 4 years, 8 months ago by Forcetalks.
- This discussion was modified 4 years, 8 months ago by Forcetalks.
- This discussion was modified 4 years, 8 months ago by Achintya.
Log In to reply.
Popular Salesforce Blogs
Using Salesforce to Manage Accounting Journeys
Many companies falsely believe that accounting is not related to customer services and business growth, making the mistake of improvising the accounting section. However, the…
What are the Basics of Async Apex Methods in 2024?
Hello Ninjas, Let's talk about Async Apex Method. Before that let's see some basics of async process. Many of the time while coding we want…
Integrating Salesforce with Accounting Solutions
With work from home becoming the new normal, companies are leveraging cloud-based technologies to make it easier for teams to access information from multiple devices.…
Popular Salesforce Videos
Salesforce Trailhead 2020 - Developer Beginner - Search Solution Basics
This video explains: Explain when to create a customized search solution. Describe the difference between SOSL and SOQL. Identify which API protocols are available for…
What are APEX Environments? | Learn Salesforce Development
In this video, Shrey explained the Apex Environments. He covered answers for the following questions while explaining: What are the APEX Environments? Different types of…
Salesforce Flow to Create Feedback form on Case | How to use Slider, Radio button on Screen Flow
Use Case: In this video, we are creating a screen flow to get feedback from the users when the case is closed. Learnings: 1. How…