{"id":8558,"date":"2022-04-07T10:53:41","date_gmt":"2022-04-07T10:53:41","guid":{"rendered":"https:\/\/www.gologica.com\/elearning\/?p=8558"},"modified":"2025-04-07T12:09:17","modified_gmt":"2025-04-07T12:09:17","slug":"how-to-create-sample-apex-trigger-in-salesforce","status":"publish","type":"post","link":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/","title":{"rendered":"How to Create Sample Apex Trigger in Salesforce?"},"content":{"rendered":"<h2 class=\"wp-block-heading\"><strong>Apex Trigger<\/strong><\/h2>\n<p><a href=\"https:\/\/www.gologica.com\/search.php?search=Apex\"><strong><em>Apex<\/em><\/strong><\/a> is a strongly typed, object-oriented programming language that approves builders to execute float and transaction manage statements on the Force.com platform server in affiliation with calls to the Force.com API. As a language Apex is integrated, convenient to use, rigorous, multi-tenant aware, upgradeable, effortless to check, and versioned. Apex Code can be initiated through Web carrier requests and from triggers on objects.<\/p>\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.gologica.com\/course\/oracle-apex\/\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/4n5S0oe9pTOEsxZ0MS6BdaNkWum1HjxjfebZlJBSdty4Z5It4UYtCmMywPBFqX6074q6EUhw1sEiYZ11ZrDK_nepbCfidoKyOO0B3FAEOodsWo3RzPfks7aFFQzt4IvQ4IfsJe3z\" alt=\"\" \/><\/a><\/figure>\n<h2 class=\"wp-block-heading\"><strong>Apex is of typically two types:<\/strong><\/h2>\n<ul class=\"wp-block-list\">\n<li>Schedulable Apex<\/li>\n<li>Batchable Apex<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\"><strong>Schedulable APEX:<\/strong><\/h3>\n<p><strong>Schedulable:-<\/strong> There is an interface in the apex which is schedulable<\/p>\n<h4 class=\"wp-block-heading\"><strong>Limitations:<\/strong><\/h4>\n<p>Eg:&nbsp;<\/p>\n<p>Schedulable {<\/p>\n<p>Void executes (schedulable context sc)<\/p>\n<p>}<\/p>\n<p>Class time bomb implements schedulable {<\/p>\n<p>Void executes (schedulable context SC) {<\/p>\n<p>System.debug (\u2018 I love you Pandu\u2019);<\/p>\n<p>} \u2193<\/p>\n<p>}to function DB operations right here<\/p>\n<h3 class=\"wp-block-heading\"><strong>Batchable Apex:<\/strong><\/h3>\n<p>Batch Apex operates over small batches of records, protecting your complete record set and breaking the manner down into manageable chunks.<\/p>\n<ol class=\"wp-block-list\">\n<li>The database is the interface for a batch apex. batchable, where<\/li>\n<li>The database is the category and<\/li>\n<li>Batchable is the interface<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\"><strong>Methods In Interface:<\/strong><\/h2>\n<p>An interface is nothing but a type in which the approach signatures are present, however, the physique of the approach is absent. Following are the strategies of an interface:<\/p>\n<ol class=\"wp-block-list\">\n<li>Start<\/li>\n<li>Execute<\/li>\n<li>Finish<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\"><strong>Start:<\/strong><\/h3>\n<p>Collect the statistics first<\/p>\n<ol class=\"wp-block-list\">\n<li>The return kind is a question locator Iterable<\/li>\n<li>Query Locator\/I Iterable begin (batchable context BC<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\"><strong>Iterable:<\/strong><\/h3>\n<p>A team of values that we can observe is Iterable<\/p>\n<p>The maximum range of values \u2192 50,000<\/p>\n<h3 class=\"wp-block-heading\"><strong>Quarry Locator:<\/strong><\/h3>\n<p>It has the ability to most of 50 million records<\/p>\n<h3 class=\"wp-block-heading\"><strong>Execute:<\/strong><\/h3>\n<p>As the records commence from the beginning and common sense\u00a0 right here is carried out on the data<\/p>\n<p>(batch able content BC, list S object &gt;) Void runs<\/p>\n<h3 class=\"wp-block-heading\"><strong>Finish:<\/strong><\/h3>\n<p>\u2192 Void end (batchable content material DC)<\/p>\n<p>\u2192 The return kind is void<\/p>\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.gologica.com\/course\/salesforce-integration-training\/\"><strong>Also Read: Salesforce Integration Training<\/strong><\/a><\/h2>\n<ol class=\"wp-block-list\">\n<li>The motive of begin approach is to gather all the records that have to be processed it returns both an Iterable (or) question locator type, the former is used to work with a most restricted of 50,000 records, whereas the latter is used up to vary of 50 million records. The output of \u2018start\u2019 goes as entered to the \u2018execute\u2019 method<\/li>\n<li>Execute technique incorporates the enterprise good judgment that has to be executed<\/li>\n<li>After finishing the process, the execute approach\u00a0 invokes the end method, whose job is to ship a notification to the\u00a0 person after performing the task<\/li>\n<li>Every technique in an interface has an international stage of visibility<\/li>\n<\/ol>\n<p>Ex:<\/p>\n<h4 class=\"wp-block-heading\"><strong>Batch Apex:<\/strong><\/h4>\n<p>Global class BA_ test implements database &lt; subject &gt; database stateful<\/p>\n<p>{<\/p>\n<p>String one_name = \u2018Krishna\u2019;<\/p>\n<p>Start with a global iterable (database batch able context bc)<\/p>\n<p>{<\/p>\n<p>List BL = new list ();<\/p>\n<p>One_name = \u2018Ashok\u2019;<\/p>\n<p>BL = \u00ab ______ \u00bb;<\/p>\n<p>CA \u2192 alias name to book_c)<\/p>\n<p>Return bl;<\/p>\n<p>}<\/p>\n<p>Global void execute (database. Batchable context BC, list &lt; book _ c &gt; BL)<\/p>\n<p>}<\/p>\n<p>Since (book _ c b: BL )<\/p>\n<p>{<\/p>\n<p>System. Debug (\u2018book name:\u2019 +b.name);<\/p>\n<p>}<\/p>\n<p>For (book_c\u00a0 b: bl)<\/p>\n<p>{<\/p>\n<p>If (b. name ==\u2019 chemistry\u2019)<\/p>\n<p>{<\/p>\n<p>b. price = c = 200;<\/p>\n<p>b. name = \u2018physics\u2019;<\/p>\n<p>b. author = c = one_name;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>Try {<\/p>\n<p>Upset BL;<\/p>\n<p>}<\/p>\n<p>Catch (Dml Exception e ) {<\/p>\n<p>System.debug (\u2018unable to process books \u2018);<\/p>\n<p>}<\/p>\n<p>For (book _c b: BL)<\/p>\n<p>{<\/p>\n<p>System.debug (\u2018book name:\u2019 +b.name);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>Global void finish (database.batch able content BC)<\/p>\n<p>{<\/p>\n<p>System.debug (\u2018updated chemistry books data is\u2019);<\/p>\n<p>}<\/p>\n<p>Public static test method void main ()<\/p>\n<p>{<\/p>\n<p>BA_test bt = new BA_test ();<\/p>\n<p>ID Jobid = database. executes batch (bt,50);<\/p>\n<p>}<\/p>\n<h3 class=\"wp-block-heading\"><strong>How To Execute Batchg Apex:<\/strong><\/h3>\n<p>To execute batch apex we ought to create a check method<\/p>\n<p>\u2192 There is an exclusive approach database. executes batch, which takes two parameters<\/p>\n<ol class=\"wp-block-list\">\n<li>Instance (or) object of the type that implements the batchable interface<\/li>\n<li>Number of files to be done per batch<\/li>\n<\/ol>\n<p>\u2192 This technique is referred to as\u00a0 interior the take a look at approach only<\/p>\n<ol class=\"wp-block-list\">\n<li>After ending come lower back to the check method<\/li>\n<li>To execute the batch technique returns the manner ID, this ID can be used for monitoring purposes.<\/li>\n<li>By default a batch is stateless<\/li>\n<li>Every batch apex is stateless, which capacity records individuals that are initialized at the start, will no longer preserve their values in execute and anyway they do no longer replicate on end method<\/li>\n<li>Every approach works in its very own context<\/li>\n<li>To execute the techniques in a kingdom full mechanism we put into effect an interface known as a database. kingdom ful<\/li>\n<li>There are no techniques in the stateful interface<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\"><strong>Triggers<\/strong><\/h3>\n<p>Triggers are database statements (or) moves that are free on the incidence of a match over the database<\/p>\n<h4 class=\"wp-block-heading\"><strong>Syntax:-<\/strong><\/h4>\n<p>Trigger trigger name on object name (trigger_events){<\/p>\n<p>Code_block<\/p>\n<p>}<\/p>\n<ol class=\"wp-block-list\">\n<li>A set-off is Apex code that executes earlier than or after particular manipulation language (DML) occasions occur, such as earlier than object documents are inserted into the database, or after archives have been deleted<\/li>\n<li>Triggers are saved as metadata in salesforce<\/li>\n<li>A listing of triggers in your org is positioned at your identify | setup | increase | apex set off |<\/li>\n<li>You can solely create triggers from the related object, now not from that of the apex triggers page<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\"><strong>There are two kinds of triggers<\/strong><\/h3>\n<ul class=\"wp-block-list\">\n<li>Before trigger<\/li>\n<li>After trigger<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\"><strong>After<\/strong><\/h4>\n<p>Insert &nbsp; &nbsp; &nbsp; Insert<\/p>\n<p>Update&nbsp; &nbsp; Update<\/p>\n<p>Delete &nbsp; &nbsp; Delete<\/p>\n<p>\u00a0\u00a0Update<\/p>\n<ol class=\"wp-block-list\">\n<li>DML statements \u2192 database (values)<\/li>\n<li>Before years capacity earlier than altering the values<\/li>\n<li>After years of skill after altering the values<\/li>\n<li>Check for a situation or error condition,<\/li>\n<li>If this situation matches, roll again the announcement and undo the effect<\/li>\n<li>Triggers work in gadget mode<\/li>\n<li>Apex triggers are viewing, checking &amp; enhancing\u00a0 solely\u00a0 and now not for growing any trigger<\/li>\n<li>Condition for a new trigger<\/li>\n<\/ol>\n<p>\u2192 Go to objects<\/p>\n<p>\u2192 The pick out object for which you are&nbsp; going to create triggers<\/p>\n<p>Ex:&nbsp; &nbsp; student<\/p>\n<p>\u2192&nbsp; Go to down the residences of student<\/p>\n<p>\u2192 Triggers \u2014&amp;gt; New<\/p>\n<p style=\"text-align:center\"><a href=\"https:\/\/www.gologica.com\/course\/sales-force\/\"><strong><em>Checkout Salesforce Tutorial<\/em><\/strong><\/a><\/p>\n<h3 class=\"wp-block-heading\"><strong>Context Variables:<\/strong><\/h3>\n<p>The context variables supply runtime records about the set of &amp;amp; the database, these variables are<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Is executing:<\/strong> It returns authentic if the set-off is underneath execution, else false<\/li>\n<li><strong>Trigger. Is before:<\/strong> Returns genuine if this set-off has been constant way earlier than any file used to be saved<\/li>\n<li><strong>Trigger. Is after:<\/strong> Returns authentic if this set-off has been constant after all archives have been saved<\/li>\n<li><strong>Trigger. is insert:<\/strong> Returns actual if this set-off has been constant due to an insert operation, accessible from the Salesforce person interface, Apex, or the API<\/li>\n<li><strong>Trigger. Is update: <\/strong>Returns authentic if this set off used to be constant due to a replace operation, from the Salesforce consumer interface, Apex, or the API<\/li>\n<li><strong>Trigger. Is delete:<\/strong> Returns proper if this set off used to be constant due to a delete operation, from the Salesforce apex, or the API<\/li>\n<li><strong>Trigger. Is UN delete:<\/strong> Returns real if this set off used to be constant after a document is recovered from the recycle bin<\/li>\n<li><strong>Trigger. New:<\/strong>\n<ul>\n<li>Reflects the new country of the database<\/li>\n<li>Returns a listing of the new variations of the challenge records<\/li>\n<li>Note that this S object listing is solely accessible in insert and replace triggers, and the documents can solely be modified in \u2018before triggers\u2019<\/li>\n<\/ul>\n<\/li>\n<li><strong>Trigger. OLD:-<\/strong>\n<ul>\n<li>Reflects the preceding kingdom of the database<\/li>\n<li>Returns a listing of\u00a0 older variations of the situation records<\/li>\n<li>Note that this S object listing is solely on hand in replace and delete triggers<\/li>\n<\/ul>\n<\/li>\n<li><strong>Trigger. New Map:-<\/strong>\n<ul>\n<li>A map of IDS to the new variations of the S object records<\/li>\n<li>Note that this map is solely reachable in \u2018before the update\u2019, \u2018after insert\u2019, and \u2018after update\u2019 triggers<\/li>\n<\/ul>\n<\/li>\n<li><strong>Trigger. Old map:-<\/strong>\n<ul>\n<li>\u2192 A map of IDS to the historic variations of the S object records<\/li>\n<li>\u2192 Note that this map is solely handy in \u2018update &amp; delete\u2019 triggers\n<ol>\n<li>Whichever set-off has been created first, it will work rapidly<\/li>\n<li>There can be a couple of triggers with comparable events<\/li>\n<li>For one set off, we have more than one conditions<\/li>\n<li>What is the distinction between the trigger? New and trigger. Old?<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u2192 Trigger. New is keeping your object report information which is being presently set by using consumer and trigger. Old includes the records of object records<\/p>\n<p>Eg:<\/p>\n<p>Trigger t1 on food_c (before insert) {<\/p>\n<p>Last &lt; food_c&gt; fc = trigger. New ;<\/p>\n<p>For (food_c f:fc)<\/p>\n<p>{<\/p>\n<p>If (f. price_c &lt;300)<\/p>\n<p>{<\/p>\n<p>f. add error (\u2018do not eat too much \u2019);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>Eg:<\/p>\n<p>Trigger t1 on student_c (before insert, after insert, before update, after update) {<\/p>\n<p>\u2192 List &lt; student_c&gt; b= trigger. New<\/p>\n<p>For (student_c&nbsp; S : b) {<\/p>\n<p>If&nbsp; (S. name_c == \u2018harishnath\u2019) {<\/p>\n<p>S. add an error (&#8216;this student is not permitted &#8216;);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<h3 class=\"wp-block-heading\"><strong>Dml Statements:<\/strong><\/h3>\n<ul class=\"wp-block-list\">\n<li>DML statements are now not affected in the DB, these are solely for trying out in Apex training using the usage of the check method<\/li>\n<li>Inside a constructor, DML statements won\u2019t execute<\/li>\n<li>DML statements are written below<\/li>\n<\/ul>\n<p>Try {<\/p>\n<p>} catch<\/p>\n<p style=\"text-align:center\"><a href=\"https:\/\/www.gologica.com\/elearning\/salesforce-interview-questions-and-answers-at-gologica\/\"><strong><em>Best Salesforce Interview Questions and Answers<\/em><\/strong><\/a><\/p>\n<h2 class=\"wp-block-heading\"><strong>Features Of Apex:<\/strong><\/h2>\n<ul class=\"wp-block-list\">\n<li>Object-oriented<\/li>\n<li>Database operations: DML, SOQL, and SOSL<\/li>\n<li>Collections<\/li>\n<li>Exceptions<\/li>\n<li>Batch apex<\/li>\n<li>Schedule apex<\/li>\n<li>Triggers (monitoring DB operations )<\/li>\n<li>Governor limits: above all runs in opposition to G.L<\/li>\n<li>Testing<\/li>\n<li>Static<\/li>\n<li>Integration<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.gologica.com\/search.php?search=salesforce+\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/ECkZBlbQ8FD1VyfB5Skdi_PryPnzabVRAJIhedcuuK8DP4GqqVSPRWELtxHc1ACvWt9Dp-zRf36MvO8tiXbVQndcT4xjvNVwMzK9z1AQYJ-V-SXS0T4N2EGdAT4QSWfIy9-vEGu5\" alt=\"\" \/><\/a><\/figure>\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n<p><a href=\"https:\/\/www.gologica.com\/search.php?search=salesforce+\"><strong><em>Salesforce<\/em><\/strong><\/a> has had great growth in terms of workers, clients, and offices throughout the world by providing creative and best-in-class ideas\/solutions to solve today&#8217;s business problems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apex Trigger Apex is a strongly typed, object-oriented programming language that approves builders to execute float and transaction manage statements &hellip;<\/p>\n","protected":false},"author":19758,"featured_media":8559,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"pmpro_default_level":"","footnotes":""},"categories":[12],"tags":[834,840,428],"coauthors":[816],"class_list":["post-8558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oracle_intervew_questions","tag-apex-training","tag-salesforce-integration-training","tag-salesforce-training","pmpro-has-access","user-has-not-earned"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create Sample Apex Trigger in Salesforce | Gologica Training<\/title>\n<meta name=\"description\" content=\"Gologica Offeres this Salesforce Online Training, Students can get hands-on expertise in handling &amp; developing apps for Salesforce fields.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Sample Apex Trigger in Salesforce | Gologica Training\" \/>\n<meta property=\"og:description\" content=\"Gologica Offeres this Salesforce Online Training, Students can get hands-on expertise in handling &amp; developing apps for Salesforce fields.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/\" \/>\n<meta property=\"og:site_name\" content=\"GoLogica\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-07T10:53:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-07T12:09:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"175\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mounika P\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mounika P\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/\"},\"author\":{\"name\":\"Mounika P\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/1aec1e5a8488bc2738614b12e01f52b0\"},\"headline\":\"How to Create Sample Apex Trigger in Salesforce?\",\"datePublished\":\"2022-04-07T10:53:41+00:00\",\"dateModified\":\"2025-04-07T12:09:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/\"},\"wordCount\":1514,\"image\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg\",\"keywords\":[\"Apex Training\",\"Salesforce Integration Training\",\"salesforce training\"],\"articleSection\":[\"Oracle\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/\",\"url\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/\",\"name\":\"How to Create Sample Apex Trigger in Salesforce | Gologica Training\",\"isPartOf\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg\",\"datePublished\":\"2022-04-07T10:53:41+00:00\",\"dateModified\":\"2025-04-07T12:09:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/1aec1e5a8488bc2738614b12e01f52b0\"},\"description\":\"Gologica Offeres this Salesforce Online Training, Students can get hands-on expertise in handling & developing apps for Salesforce fields.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage\",\"url\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg\",\"contentUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg\",\"width\":300,\"height\":175},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.gologica.com\/elearning\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Sample Apex Trigger in Salesforce?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#website\",\"url\":\"https:\/\/www.gologica.com\/elearning\/\",\"name\":\"GoLogica\",\"description\":\"E-Learning Portal\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gologica.com\/elearning\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/1aec1e5a8488bc2738614b12e01f52b0\",\"name\":\"Mounika P\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/image\/d0ab308492a1bfcbec1a1ce1637996db\",\"url\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg\",\"contentUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg\",\"caption\":\"Mounika P\"},\"url\":\"https:\/\/www.gologica.com\/elearning\/author\/mounika\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Sample Apex Trigger in Salesforce | Gologica Training","description":"Gologica Offeres this Salesforce Online Training, Students can get hands-on expertise in handling & developing apps for Salesforce fields.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Sample Apex Trigger in Salesforce | Gologica Training","og_description":"Gologica Offeres this Salesforce Online Training, Students can get hands-on expertise in handling & developing apps for Salesforce fields.","og_url":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/","og_site_name":"GoLogica","article_published_time":"2022-04-07T10:53:41+00:00","article_modified_time":"2025-04-07T12:09:17+00:00","og_image":[{"width":300,"height":175,"url":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg","type":"image\/jpeg"}],"author":"Mounika P","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mounika P","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#article","isPartOf":{"@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/"},"author":{"name":"Mounika P","@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/1aec1e5a8488bc2738614b12e01f52b0"},"headline":"How to Create Sample Apex Trigger in Salesforce?","datePublished":"2022-04-07T10:53:41+00:00","dateModified":"2025-04-07T12:09:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/"},"wordCount":1514,"image":{"@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg","keywords":["Apex Training","Salesforce Integration Training","salesforce training"],"articleSection":["Oracle"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/","url":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/","name":"How to Create Sample Apex Trigger in Salesforce | Gologica Training","isPartOf":{"@id":"https:\/\/www.gologica.com\/elearning\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage"},"image":{"@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg","datePublished":"2022-04-07T10:53:41+00:00","dateModified":"2025-04-07T12:09:17+00:00","author":{"@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/1aec1e5a8488bc2738614b12e01f52b0"},"description":"Gologica Offeres this Salesforce Online Training, Students can get hands-on expertise in handling & developing apps for Salesforce fields.","breadcrumb":{"@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#primaryimage","url":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg","contentUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2022\/04\/Overview-of-Apex-Trigger.jpg","width":300,"height":175},{"@type":"BreadcrumbList","@id":"https:\/\/www.gologica.com\/elearning\/how-to-create-sample-apex-trigger-in-salesforce\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.gologica.com\/elearning\/"},{"@type":"ListItem","position":2,"name":"How to Create Sample Apex Trigger in Salesforce?"}]},{"@type":"WebSite","@id":"https:\/\/www.gologica.com\/elearning\/#website","url":"https:\/\/www.gologica.com\/elearning\/","name":"GoLogica","description":"E-Learning Portal","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gologica.com\/elearning\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/1aec1e5a8488bc2738614b12e01f52b0","name":"Mounika P","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/image\/d0ab308492a1bfcbec1a1ce1637996db","url":"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg","contentUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg","caption":"Mounika P"},"url":"https:\/\/www.gologica.com\/elearning\/author\/mounika\/"}]}},"_links":{"self":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts\/8558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/users\/19758"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/comments?post=8558"}],"version-history":[{"count":1,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts\/8558\/revisions"}],"predecessor-version":[{"id":8560,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts\/8558\/revisions\/8560"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/media\/8559"}],"wp:attachment":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/media?parent=8558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/categories?post=8558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/tags?post=8558"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/coauthors?post=8558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}