-
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, 7 months ago by Forcetalks.
- This discussion was modified 4 years, 7 months ago by Forcetalks.
- This discussion was modified 4 years, 7 months ago by Achintya.
Log In to reply.
Popular Salesforce Blogs
Automate Salesforce Data Import/Export Using Data Loader CLI
One of the key facets of Salesforce is import and export data from salesforce. Data loader is a great tool provided by Salesforce to achieve…
Einstein GPT: the first generative AI for CRM
Since its release in November 2022, Chat GPT has become a buzzword - over a million people signed up to use it in just five…
CTI Integration with Salesforce and Its Benefits
Now, when we are aware of the system of CRM, i.e. Customer Relationship Management, there is one other system as well, known as CTI. The…
Popular Salesforce Videos
Salesforce Interface Sends a Command With Parameters to UiPath Assistant Using JavaScript
Salesforce interface sends a command with parameters to UiPath Assistant using Robotjs Code: https://github.com/cristinegulescu/startUiPathFromSalesforce/blob/master/SalesForceLocal.txt
Salesforce Consultant Certifications - Large Data and Transaction Volumes
As you already aware, expertise in Salesforce is in huge demand. The Salesforce Certifications are industry-recognized and are a proof of your skill/expertise in Salesforce.…
Develop a Basic Slack App For Salesforce
Build Slack Apps integrated with Salesforce. Use Heroku to host Slack apps built using Slack Bolt Framework and get connected to Salesforce using Node.js library…