-
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, 2 months ago by Forcetalks.
- This discussion was modified 5 years, 2 months ago by Forcetalks.
- This discussion was modified 5 years, 2 months ago by Achintya.
Log In to reply.
Popular Salesforce Blogs
How To Use Tokens in Salesforce Lightning?
This is one of the cool features of Salesforce lightning mainly used for styling in components.You need to define code, values only once and use…
Top 5 Use Cases of Salesforce Partner Portal
Struggling to work together with external partners on projects? A Salesforce partner portal is your solution! These portals act as a central hub for your…
The Future Of Development On Salesforce Is With Lightning Experience
As per the Salesforce release of 2017 a number of features has been added to the Salesforce Lightning Platform. The enterprises which are using Salesforce…
Popular Salesforce Videos
What is Approval Process in Salesforce?
Automated process that approves records for the organization and it can be defined with a sequence of steps. Watch the video to learn and if…
Salesforce & Google Analytics integration
Salesforce is one of the most popular CRMs available today. Many teams use Salesforce heavily for reporting and analysis. The ability to model the data…
Email-to-Case Advance | Clean Case Comments
Save your support reps from ‘Click fatigue’ while hastening the resolution of customer cases. Get Email to Case Advance, the much-needed power booster for your…