-
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 ago by
Forcetalks.
-
This discussion was modified 7 years ago by
Forcetalks.
-
This discussion was modified 7 years ago by
Achintya.
-
This discussion was modified 7 years ago by
Log In to reply.
Popular Salesforce Blogs
Elevate Customer Engagement With Salesforce Marketing Cloud
Generating high-quality leads is critical for any business in today’s competitive world. But how do you connect with your customers more personally and meaningfully? Implementing…
How To Manage Duplicate Records In Salesforce?
It becomes utmost important to detect potential duplicates when records are being updated in the system via integration i.e when all the records like accounts,…
Switching from MS Dynamics to Salesforce | Learn Here
Introduction Talking about a CRM both MS Dynamics and Salesforce are great platforms to work on. But with the advancement and upgradation in technological development,…
Popular Salesforce Videos
How Can Salesforce Help To Transform Business Into A Sales Powerhouse?
This video will help you understand what is Salesforce and how it can help transform businesses. Salesforce CRM will help to transform your organization to…
Creating Multi Screen Wizard Using Apex and Visualforce Salesforce
Watch this video to learn how to create a Multi-screen wizard using Apex and Visualforce Salesforce. If you have any questions do let us know…
Algoworks is Now a Salesforce Gold Partner
Being just a registered partner back in 2013, the journey to striking Gold in 2020 has been long. On the way to getting that Gold,…