-
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
Salesforce: How AI, CRM, and Einstein 1 Are Transforming Businesses in the USA
Businesses are rushing to improve their customer interactions, optimise processes, and achieve growth in today's fast-paced digital environment. Salesforce, the world's Top AI-powered CRM platform…
Unique Features of Salesforce Marketing Cloud
Is it true that you think that it is hard to connect with your customers and build relationships with them? Is your company in need…
SEO for Salesforce Experience Cloud Websites: Best Practices
Salesforce Experience Cloud provides a powerful platform for building engaging online spaces for various business purposes. However, it's crucial to ensure that your community is…
Popular Salesforce Videos
Algoworks Becomes SFDO Partner | Salesforce Partner
The Salesforce Partner Program gives the opportunity to its partners to build and grow successful businesses while delivering customer success. With this program, Independent Software…
Add In-App Guidance to Salesforce Lightning Experience
In Lightning Experience, add prompts that appear on-screen to users working in an app. Use prompts to onboard and train users, highlight configuration changes and…
100 Hours of Dreamforce on Salesforce+
Mark your calendar… get set… GO! Dreamforce 2021 is coming to you. So let's come together, from wherever you are, to learn, connect, have fun,…