<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>apex | Taha Syed | Salesforce</title>
<atom:link href="https://www.syedtaha.com/tag/apex/feed/" rel="self" type="application/rss+xml" /><link>https://www.syedtaha.com</link>
<description>Taha Syed &#124; Sales to Salesforce &#124; Dissecting and Defining the Rationale..</description>
<lastBuildDate>Mon, 17 Dec 2018 20:19:16 +0000</lastBuildDate>
<language>en-US</language>
<sy:updatePeriod>
hourly	</sy:updatePeriod>
<sy:updateFrequency>
1	</sy:updateFrequency>
<generator>https://wordpress.org/?v=6.9.4</generator>
<item><title>Trigger to Post Automated Random Chatter Comment</title><link>https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-post-automated-random-chatter-comment/1099/</link>
<comments>https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-post-automated-random-chatter-comment/1099/#respond</comments>
<dc:creator><![CDATA[Taha Syed]]></dc:creator>
<pubDate>Mon, 03 Dec 2018 20:45:03 +0000</pubDate>
<category><![CDATA[Apex Triggers]]></category>
<category><![CDATA[apex]]></category>
<category><![CDATA[chatter]]></category>
<category><![CDATA[comment]]></category>
<category><![CDATA[feedcomment]]></category>
<category><![CDATA[feeditem]]></category>
<category><![CDATA[post]]></category>
<category><![CDATA[salesforce]]></category>
<category><![CDATA[trigger]]></category>
<guid
isPermaLink="false">http://www.syedtaha.com/?p=1099</guid><description><![CDATA[<p>Apex Trigger to post an automated random comment whenever a chatter post is published. When any user posts to chatter and if the user's post contains the term "Success", an automated comment should be posted. This comment should be randomly selected from a list of comments; And should be posted as a specific user.</p>
The post <a
href="https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-post-automated-random-chatter-comment/1099/">Trigger to Post Automated Random Chatter Comment</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></description>
<content:encoded><![CDATA[<p><strong>Requirement: </strong>Write a trigger to post an automated random comment whenever a chatter post is published.<br
/>
<strong>Use Case:</strong> When any user posts to chatter and if the user&#8217;s post contains the term &#8220;Success&#8221;, an automated comment should be posted. This comment should be randomly selected from a list of comments; And should be posted as a specific user.</p><p>To achieve this requirement, we will be using two Chatter objects viz. <strong>Feed Item</strong> and <strong>Feed Comment. &#8216;</strong>Feed Item&#8217; records are the posts created by a User and the &#8216;Feed Comment&#8217; records are the comments on that post.</p><p>In other words, our requirement is to <strong>insert a random &#8216;Feed Comment&#8217; record, whenever a &#8216;Feed Item&#8217; record is inserted.</strong></p><p>The Trigger should be written with the following flow:</p><ol><li>Define the Trigger</li><li>Create a list for DML (last step)</li><li>Create a List of &#8216;Strings&#8217;/ Comments</li><li>Get a Random comment from the List in Step 3</li><li>Iterate through each Feed Item record in the List from Step 2. and add the random comment.</li><li>DML to insert List of newly created records</li></ol><p>&nbsp;</p><p>Now lets go through each step once again and write its respective code.</p><div
class="tab_widget wp_shortcodes_tabs"><ul
class="wps_tabs"><li><a
href="#" data-tab="tab-0-step-1">Step 1</a></li><li><a
href="#" data-tab="tab-1-step-2">Step 2</a></li><li><a
href="#" data-tab="tab-2-step-3">Step 3</a></li><li><a
href="#" data-tab="tab-3-step-4">Step 4</a></li><li><a
href="#" data-tab="tab-4-step-5">Step 5</a></li><li><a
href="#" data-tab="tab-5-step-6">Step 6</a></li></ul><div
class="tab_container"><div
id="tab-0-step-1" class="tab_content clearfix"></p><h2>Defining the trigger (the trigger syntax)</h2><p>Lets name our trigger <strong>randomChatterComment. </strong>The trigger will be on the <strong>FeedItem </strong>object and will be an <strong>After Insert</strong> trigger.</p><p>But why an after insert trigger? That's because the requirement is to create a comment on the FeedItem record being inserted. And we will need the FeedItems' ID to relate the Comment to it. The ID's and other system fields are available only in an <strong>after</strong> trigger.</p><p>The code defining our trigger will be:</p><pre class="lang:default decode:true" title="Step 1">trigger randomChatterComment on FeedItem (after insert) {</pre><p></div><div
id="tab-1-step-2" class="tab_content clearfix"></p><h2>Create a List of FeedComments for the final insert</h2><p>In this step, we will create a List of FeedComments that will be used in DML (last step)</p><pre class="lang:default decode:true ">    //Create a list to hold the list of Feed Comment records being inserted
    List&lt;FeedComment&gt; List2insert = New list&lt;FeedComment&gt;();</pre><p>&nbsp;</p><p></div><div
id="tab-2-step-3" class="tab_content clearfix"></p><h2>Create a List of Strings/Comments</h2><p>In this step, we will create a list of Strings (comments) from which a random one will be selected in the next step.</p><pre class="lang:default decode:true ">//Create a list of Strings
    List&lt;String&gt; commentList = New List&lt;String&gt;{
        'Congratulations and BRAVO!',
            'This calls for celebrating! Congratulations!',
            'You did it! So proud of you!',
            'I knew it was only a matter of time. Well done!',
            'Congratulations on your well-deserved success.',
            'Heartfelt congratulations to you.',
            'Warmest congratulations on your achievement.',
            'Congratulations and best wishes for your next adventure!',
            'So pleased to see you accomplishing great things.',
            'Feeling so much joy for you today. What an impressive achievement!',
            'You’ve worked so hard for this. Congrats!',
            'This is awesome! You’re awesome! Way to go!',
            'Here’s to your streak! Keep it up!',
            'Sincere congratulations on your hard-earned success',
            'You are proof that good things come to those who are willing to sacrifice to reach a worthwhile goal. Words can’t express how proud I am!',
            'You have the creativity and determination to do whatever you can dream. I hope you feel proud today and confident in your ability to rise to your next challenge.',
            'Celebrating the dedication you’ve shown on the way to this achievement. You’ve earned every bit of the success you’re enjoying.',
            'Congrats!!!'           
            };</pre><p></div><div
id="tab-3-step-4" class="tab_content clearfix"></p><h2>Get a Random Comment</h2><p>To get a random comment, we will first generate a random number. Then use the GET method to retrieve a comment from the List.</p><pre class="lang:default decode:true ">//Get a random number which is less than the size of the above list
   Integer i = (Math.random()* (commentList.size() -1)).intvalue();</pre><p></div><div
id="tab-4-step-5" class="tab_content clearfix"></p><h2>Iterate through Feed Item records and add comment</h2><p>In this step, we will iterate through each FeedItem record that entered the trigger. Remember, these are the records available in trigger.new</p><p>We will also use an If condition to check if the FeedItem record contains the word 'Success'. If yes, a we will create a FeedComment record with a random comment.</p><p>We will then add all the newly created FeedComment records to a final List that will be used in DML in the next step.</p><pre class="lang:default decode:true">    //iterate through each feed item record and add the comments
    For (FeedItem FIR:Trigger.new) { 
        //check if the post contains the word "Success"
        If (FIR.Body.contains('success')) {
            FeedComment FC = New FeedComment(); 
            FC.CommentBody = commentList.get(i);//add a random comment from the comment list using the random number generated earlier
            FC.FeedItemID = FIR.id;
            FC.CreatedById = '005f4000002NG0g'; //ID of user who will be commenting
            List2insert.add(fc); //add to final list of comments that needs to be inserted
        }
    }</pre><p>&nbsp;</p><p></div><div
id="tab-5-step-6" class="tab_content clearfix"></p><h2>DML to Insert the List of Feed Comments</h2><pre class="lang:default decode:true">Insert List2insert; // insert the final list of comments</pre><p></div></div></div><div
class="clear"></div><p>&nbsp;</p><p><strong>The complete trigger to post a random chatter comment will be as follows:</strong></p><pre class="lang:default decode:true ">trigger randomChatterComment on FeedItem (after insert) {
    
    //Create a list to hold the list of Feed Comment records being inserted
    List&lt;FeedComment&gt; List2insert = New list&lt;FeedComment&gt;();
    
    //Create a list of comments
    List&lt;String&gt; commentList = New List&lt;String&gt;{
        'Congratulations and BRAVO!',
            'This calls for celebrating! Congratulations!',
            'You did it! So proud of you!',
            'I knew it was only a matter of time. Well done!',
            'Congratulations on your well-deserved success.',
            'Heartfelt congratulations to you.',
            'Warmest congratulations on your achievement.',
            'Congratulations and best wishes for your next adventure!',
            'So pleased to see you accomplishing great things.',
            'Feeling so much joy for you today. What an impressive achievement!',
            'You’ve worked so hard for this. Congrats!',
            'This is awesome! You’re awesome! Way to go!',
            'Here’s to your streak! Keep it up!',
            'Sincere congratulations on your hard-earned success',
            'You are proof that good things come to those who are willing to sacrifice to reach a worthwhile goal. Words can’t express how proud I am!',
            'You have the creativity and determination to do whatever you can dream. I hope you feel proud today and confident in your ability to rise to your next challenge.',
            'Celebrating the dedication you’ve shown on the way to this achievement. You’ve earned every bit of the success you’re enjoying.',
            'Congrats!!!'           
            };
                //Get a random number which is less than the size of the above list
                Integer i = (Math.random()* (commentList.size() -1)).intvalue();
    
    //iterate through each feed item record and add the comments
    For (FeedItem FIR:trigger.new) { 
        //check if the post contains the word "Success"
        If (FIR.Body.contains('success')) {
            FeedComment FC = New FeedComment(); 
            FC.CommentBody = commentList.get(i);//add a random comment from the comment list using the random number generated earlier
            FC.FeedItemID = FIR.id;
            FC.CreatedById = '005f4000002NG0g'; //ID of user who will be commenting
            List2insert.add(fc); //add to final list of comments that needs to be inserted
        }
    }
    Insert List2insert; // insert the final list of comments
    
}</pre><p>&nbsp;</p>The post <a
href="https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-post-automated-random-chatter-comment/1099/">Trigger to Post Automated Random Chatter Comment</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></content:encoded>
<wfw:commentRss>https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-post-automated-random-chatter-comment/1099/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item><title>Trigger to create task when Opportunity is updated &#8211; Salesforce Apex Triggers</title><link>https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-create-task-when-opportunity-is-updated-salesforce-apex-triggers/958/</link>
<comments>https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-create-task-when-opportunity-is-updated-salesforce-apex-triggers/958/#respond</comments>
<dc:creator><![CDATA[Taha Syed]]></dc:creator>
<pubDate>Wed, 25 Jul 2018 19:57:06 +0000</pubDate>
<category><![CDATA[Apex Triggers]]></category>
<category><![CDATA[apex]]></category>
<category><![CDATA[create task]]></category>
<category><![CDATA[opportunity]]></category>
<category><![CDATA[salesforce trigger]]></category>
<category><![CDATA[trigger on opportunity]]></category>
<category><![CDATA[triggers]]></category>
<guid
isPermaLink="false">http://www.syedtaha.com/?p=958</guid><description><![CDATA[<p>Salesforce Apex Trigger to create a Task when an Opportunity is updated. The task should be assigned to the Opportunity owner and the status of the task should be "In Progress". - Salesforce Apex Trigger Examples</p>
The post <a
href="https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-create-task-when-opportunity-is-updated-salesforce-apex-triggers/958/">Trigger to create task when Opportunity is updated – Salesforce Apex Triggers</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></description>
<content:encoded><![CDATA[<h1>Trigger to create a task when an Opportunity is updated &#8211; Salesforce Apex Triggers for Beginners.</h1><p><strong>Requirement: </strong>Write a Salesforce Apex Trigger to create a Task when an Opportunity is updated. The task should be assigned to the Opportunity owner and the status of the task should be &#8220;In Progress&#8221;.</p><p><strong>The Salesforce Apex Trigger Sytax is as follows:</strong></p><pre class="lang:default decode:true" title="Apex Trigger Syntax">trigger *triggerName* on *Object* (*before/after event*) {
    for (*Object* *Variable* : Trigger.New)      
        **Trigger Actions &amp; Code Block**
}</pre><p>&nbsp;</p><p>Now lets write our trigger with the following steps.</p><ol><li> Define the trigger</li><li> Iterate through each opportunity</li><li> Create a Task</li><li> Assign values to the Task</li></ol><div
class="tab_widget wp_shortcodes_tabs"><ul
class="wps_tabs"><li><a
href="#" data-tab="tab-0-step-1">Step 1</a></li><li><a
href="#" data-tab="tab-1-step-2">Step 2</a></li><li><a
href="#" data-tab="tab-2-step-3">Step 3</a></li><li><a
href="#" data-tab="tab-3-step-4">Step 4</a></li></ul><div
class="tab_container"><div
id="tab-0-step-1" class="tab_content clearfix"><br
/>
////define the trigger name, object and events</p><pre class="lang:default decode:true">trigger createTaskOnOpp on Opportunity (before update) {</pre><p></div><div
id="tab-1-step-2" class="tab_content clearfix"><br
/>
//Iterate through each opportunity and assign it the variable Opp</p><pre class="lang:default decode:true ">for (Opportunity Opp :Trigger.New) {</pre><p></div><div
id="tab-2-step-3" class="tab_content clearfix"><br
/>
//Create a new task and assign it the variable <strong>t</strong></p><pre class="lang:default decode:true ">Task t = new Task();</pre><p></div><div
id="tab-3-step-4" class="tab_content clearfix"></p><p>//Assign Values to the task <strong>t</strong></p><pre class="lang:default decode:true">	t.WhatID = Opp.Id;
	t.Ownerid = opp.Ownerid;
	t.subject = 'This is the Subject';
	t.Status = 'In Progress';
	t.Description = 'This is the Description';
	insert t;
	}
}</pre><p></div></div></div><div
class="clear"></div><p>The complete Salesforce Apex Trigger to create a Task when an Opportunity is updated would be:</p><pre class="lang:default decode:true">////define the trigger name, object and events
trigger createTaskOnOpp on Opportunity (before update) {
    //Iterate through each opportunity and assign it the variable Opp
    for (Opportunity Opp :Trigger.New) {
	//Create a new task and assign it the variable t
        Task t = new Task();
        // Assign Values to the task t
        t.WhatID          = Opp.Id;
        t.Ownerid         = opp.Ownerid;
        t.subject 	  = 'This is the Subject';
        t.Status	  = 'In Progress';
        t.Description     = 'This is the Description';
        insert t;
    }
}</pre><p>&nbsp;</p><p>This is how the trigger looks in the developer console (image)</p><figure
id="attachment_976" aria-describedby="caption-attachment-976" style="width: 818px" class="wp-caption alignnone"><img
fetchpriority="high" decoding="async" class="wp-image-976 size-full" src="http://www.syedtaha.com/wp-content/uploads/2018/07/Trigger-to-create-Task-when-Opportunity-is-updated.png" alt="Trigger to create Task when Opportunity is updated" width="818" height="514" srcset="https://www.syedtaha.com/wp-content/uploads/2018/07/Trigger-to-create-Task-when-Opportunity-is-updated.png 818w, https://www.syedtaha.com/wp-content/uploads/2018/07/Trigger-to-create-Task-when-Opportunity-is-updated-300x189.png 300w, https://www.syedtaha.com/wp-content/uploads/2018/07/Trigger-to-create-Task-when-Opportunity-is-updated-768x483.png 768w" sizes="(max-width: 818px) 100vw, 818px" /><figcaption
id="caption-attachment-976" class="wp-caption-text">Trigger to create Task when Opportunity is updated</figcaption></figure><p>&nbsp;</p><p>&nbsp;</p>The post <a
href="https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-create-task-when-opportunity-is-updated-salesforce-apex-triggers/958/">Trigger to create task when Opportunity is updated – Salesforce Apex Triggers</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></content:encoded>
<wfw:commentRss>https://www.syedtaha.com/salesforce-apex-triggers/trigger-to-create-task-when-opportunity-is-updated-salesforce-apex-triggers/958/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item><title>Write Your First Hello World Salesforce Apex Trigger &#8211; Triggers for Beginners</title><link>https://www.syedtaha.com/salesforce-apex-triggers/write-your-first-hello-world-salesforce-apex-trigger-triggers-for-beginners/946/</link>
<comments>https://www.syedtaha.com/salesforce-apex-triggers/write-your-first-hello-world-salesforce-apex-trigger-triggers-for-beginners/946/#respond</comments>
<dc:creator><![CDATA[Taha Syed]]></dc:creator>
<pubDate>Tue, 03 Jul 2018 20:57:23 +0000</pubDate>
<category><![CDATA[Apex Triggers]]></category>
<category><![CDATA[apex]]></category>
<category><![CDATA[apex trigger]]></category>
<category><![CDATA[beginners triggers]]></category>
<category><![CDATA[lead]]></category>
<category><![CDATA[salesforce trigger]]></category>
<category><![CDATA[triggers]]></category>
<guid
isPermaLink="false">http://www.syedtaha.com/?p=946</guid><description><![CDATA[<p>Let's write our first "Hello World" Salesforce Apex trigger which will update a Lead with "Hello" as the first name and World" as the last name.<br
/>
The "Hello World" program is the simplest program used to illustrate the basic syntax of a programming language. The program outputs "Hello World" and is traditionally the first program written by all beginner developers.</p>
The post <a
href="https://www.syedtaha.com/salesforce-apex-triggers/write-your-first-hello-world-salesforce-apex-trigger-triggers-for-beginners/946/">Write Your First Hello World Salesforce Apex Trigger – Triggers for Beginners</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></description>
<content:encoded><![CDATA[<h1>Apex Triggers for Beginners</h1><p>The &#8220;Hello World&#8221; program is the simplest program used to illustrate the basic syntax of a programming language. The program outputs &#8220;Hello World&#8221; and is traditionally the first program written by all beginner developers.</p><p>Let&#8217;s write our first &#8220;Hello World&#8221; Salesforce Apex trigger which will update a Lead with &#8220;Hello&#8221; as the first name and &#8220;World&#8221; as the last name.</p><p><strong>Requirement:</strong><br
/>
When a Lead is updated, update the lead&#8217;s first name to &#8216;Hello&#8217; and last name to &#8216;World&#8217;</p><p>Lets write the trigger in the &#8220;Developer Console&#8221;. To access the developer console, click the drop down on your <strong>Name</strong> (on the top right), and then click on <strong>Developer Console.</strong></p><figure
id="attachment_950" aria-describedby="caption-attachment-950" style="width: 1024px" class="wp-caption alignnone"><img
decoding="async" class="wp-image-950 size-large" src="http://www.syedtaha.com/wp-content/uploads/2018/07/Salesforce-Developer-Console-1024x185.png" alt="Salesforce Developer Console" width="1024" height="185" srcset="https://www.syedtaha.com/wp-content/uploads/2018/07/Salesforce-Developer-Console-1024x185.png 1024w, https://www.syedtaha.com/wp-content/uploads/2018/07/Salesforce-Developer-Console-300x54.png 300w, https://www.syedtaha.com/wp-content/uploads/2018/07/Salesforce-Developer-Console-768x139.png 768w, https://www.syedtaha.com/wp-content/uploads/2018/07/Salesforce-Developer-Console.png 1551w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption
id="caption-attachment-950" class="wp-caption-text">Salesforce Developer Console</figcaption></figure><p>&nbsp;</p><p>Once the developer console is open, click on <strong>File &gt;&gt; Open &gt;&gt; Apex Trigger. </strong>Now we are ready to write our first trigger.</p><figure
id="attachment_951" aria-describedby="caption-attachment-951" style="width: 560px" class="wp-caption aligncenter"><img
decoding="async" class="wp-image-951 size-full" src="http://www.syedtaha.com/wp-content/uploads/2018/07/Open-Apex-Trigger-in-Developer-Console.png" alt="Open Apex Trigger in Developer Console" width="560" height="421" srcset="https://www.syedtaha.com/wp-content/uploads/2018/07/Open-Apex-Trigger-in-Developer-Console.png 560w, https://www.syedtaha.com/wp-content/uploads/2018/07/Open-Apex-Trigger-in-Developer-Console-300x226.png 300w, https://www.syedtaha.com/wp-content/uploads/2018/07/Open-Apex-Trigger-in-Developer-Console-320x240.png 320w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption
id="caption-attachment-951" class="wp-caption-text">Open Apex Trigger in Developer Console</figcaption></figure><p>&nbsp;</p><p><strong>The Trigger Syntax:</strong><br
/>
Every trigger is defined by using the following syntax:</p><pre class="top-margin:20 bottom-margin:20 left-margin:20 right-margin:20 lang:go range:1-10 decode:true">  trigger *triggerName* on *Object* (*before/after event*) {
       for (*Object* *Variable* : Trigger.New)
       **Trigger Actions &amp; Code Block**
  }</pre><p>&nbsp;</p><p>Here is what the terms in the syntax mean:</p><ul><li>&#8216;triggerName&#8217; is the name of the trigger which describes it.</li><li>&#8216;Object&#8217; is the name of the Object on which the trigger is created</li><li>&#8216;before/after event&#8217; are a comma separated list of events like insert, update, delete</li><li>&#8216;Trigger.New&#8217; is a list of sObject records</li><li>&#8216;Variable&#8217; denote a piece of memory that can contain a data value. Descriptive text is used as variables.</li></ul><p>Lets get back to our requirement and based on the above syntax, write our <strong>&#8216;Hello World&#8217; Salesforce Apex trigger</strong>.<br
/>
Remember, when a <strong>Lead</strong> is <strong>updated</strong>, the <strong>first nam</strong>e should be updated to &#8220;<strong>Hello</strong>&#8221; and the <strong>Last Name</strong> to &#8220;<strong>World</strong>&#8220;.</p><p>We will be using <strong>comments</strong> to <strong>describe the lines of code</strong> in our <strong>trigger</strong>. But what are comments? <strong>Comments are used to describe code</strong> and are ignored by the parser &#8211; meaning the comments are NOT treated as code and will not run.<br
/>
Single line comments are preceded by // and multi line comments are wrapped in /* and */</p><p>Now here comes the trigger:</p><pre class="lang:default decode:true">// Name of the trigger is HelloWorld, It is on the Lead Object and It will run before the lead is updated (event).
trigger HelloWorld on Lead (before update) {
        //for every lead record, denoted by variable ld,in the list that is being updated
        for (lead ld : Trigger.new) {
             // add the first name as 'Hello'
             ld.FirstName = 'Hello';
             // add the last name as 'World'
             ld.LastName = 'World';
         }
}</pre><p>&nbsp;</p><p>This is how it looks in the developer console.</p><figure
id="attachment_955" aria-describedby="caption-attachment-955" style="width: 726px" class="wp-caption alignnone"><img
loading="lazy" decoding="async" class="wp-image-955 size-full" src="http://www.syedtaha.com/wp-content/uploads/2018/07/Hello-World-Salesforce-Apex-Trigger-1.png" alt="Hello World Salesforce Apex Trigger" width="726" height="354" srcset="https://www.syedtaha.com/wp-content/uploads/2018/07/Hello-World-Salesforce-Apex-Trigger-1.png 726w, https://www.syedtaha.com/wp-content/uploads/2018/07/Hello-World-Salesforce-Apex-Trigger-1-300x146.png 300w" sizes="auto, (max-width: 726px) 100vw, 726px" /><figcaption
id="caption-attachment-955" class="wp-caption-text">Hello World Salesforce Apex Trigger</figcaption></figure><p>&nbsp;</p><p><strong>Exercise to get used to the syntax and the basic trigger for beginners:</strong></p><p>Write a trigger to update the first name of the contact as Taha and the last name as Syed and the Phone number as 000-111-9999</p>The post <a
href="https://www.syedtaha.com/salesforce-apex-triggers/write-your-first-hello-world-salesforce-apex-trigger-triggers-for-beginners/946/">Write Your First Hello World Salesforce Apex Trigger – Triggers for Beginners</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></content:encoded>
<wfw:commentRss>https://www.syedtaha.com/salesforce-apex-triggers/write-your-first-hello-world-salesforce-apex-trigger-triggers-for-beginners/946/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
</channel>
</rss>