-
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, 5 months ago by
Forcetalks.
-
This discussion was modified 5 years, 5 months ago by
Forcetalks.
-
This discussion was modified 5 years, 5 months ago by
Achintya.
-
This discussion was modified 5 years, 5 months ago by
Log In to reply.
Popular Salesforce Blogs
![Lead Management](https://images.forcetalks.com/wp-content/uploads/2021/02/11165723/Lead-Management.jpg)
Salesforce Opportunity Management and Lead Management
What are some of the key reasons for the decline of the lead conversion ratio? Jeff Bezos, sales manager at a logistics company, is fed…
![picklist](https://images.forcetalks.com/wp-content/uploads/2020/06/25172944/picklist.png)
Sort Picklist Values in Lightning Component | Salesforce Tutorials
In this article, you will learn to sort the values in Picklist in Lightning Component. You just have to add an additional line to your…
![](https://images.forcetalks.com/wp-content/uploads/2024/06/06130332/sa_1717678841How%20do%20I%20Choose%20a%20Salesforce%20Implementation%20Partner.jpg)
How do I Choose a Salesforce Implementation Partner?
Hey there! If you’re reading this, chances are you’re looking to take your business to the next level with Salesforce. That’s a fantastic move! Salesforce…
Popular Salesforce Videos
Reason to Switch the Job | Future of Salesforce Job Market | Christopher A Hopper
Here is the Glimpse of Conversation with Christopher A Hopper on the topic "Reason to Switch the Job". This is the very first episode of…
Salesforce Summer '18 Release
I can’t believe Summer ’18 is already here in no time. I don’t know about all of you, but I still have my winter stuff…
How to Find Volunteer Work as a Salesforce Professional
In this video, Brad discusses how to generate work experience through volunteer jobs. These jobs allow for new professionals to gain Salesforce specific, applicable knowledge…