tag:blogger.com,1999:blog-3283225244263709141.post4680409662605353363..comments2024-01-10T06:45:08.295-08:00Comments on Salesforce Ninja: An Elite Blog about Salesforce.com: The Basics of writing a Apex TriggerSiddhesh Kabehttp://www.blogger.com/profile/05949517024873104589noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-3283225244263709141.post-53823129815450609082014-03-04T05:08:38.481-08:002014-03-04T05:08:38.481-08:00It should be id=:theOpportunity.Accountid]. Colon ...It should be id=:theOpportunity.Accountid]. Colon (:) would come after equal sign (=).Anonymoushttps://www.blogger.com/profile/04235758823142834749noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-27829764110003708122013-12-24T22:46:32.573-08:002013-12-24T22:46:32.573-08:00Can you suggest how to write a trigger on a select...Can you suggest how to write a trigger on a selection of a lookup custom recird to populate a currency field? Thanks in advance.MNZhttps://www.blogger.com/profile/00774278539358728313noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-51854973952228957342013-10-31T02:41:46.494-07:002013-10-31T02:41:46.494-07:00I want to delete only those accounts with whom any...I want to delete only those accounts with whom any opportunities are associated.that means accounts without any opportunities only get delete..how would i write trigger for that?Anonymoushttps://www.blogger.com/profile/15662683885714477088noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-84205886296631926532013-10-28T02:46:10.690-07:002013-10-28T02:46:10.690-07:00Very helpful.. :)Very helpful.. :)pranalihttps://www.blogger.com/profile/17273126193562090021noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-3762292274100960732013-10-09T01:47:17.520-07:002013-10-09T01:47:17.520-07:00It is from trigger.new[0] the only reason why you ...It is from trigger.new[0] the only reason why you will need trigger.old would be probably to save the values in Update trigger.Siddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-81596353452300044462013-10-08T22:44:34.338-07:002013-10-08T22:44:34.338-07:00We just brought the first record updated from the ...We just brought the first record updated from the Trigger.Old[0] to TheOpportunity variable (We can directly operate on Trigger.old[0] however code looks messy, developer is an endangered species, spare the messiness)<br /><br />is it from Trigger.Old[0] or Trigger.new[0]?dasfrogpracticehttps://www.blogger.com/profile/01440451480882186270noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-42354681846167774092013-09-27T08:35:01.025-07:002013-09-27T08:35:01.025-07:00Hi Iam in learning stageof SFDC this is very helpf...Hi Iam in learning stageof SFDC this is very helpful to us,we need ur suggestions on SFDC Anonymoushttps://www.blogger.com/profile/15755087123181302474noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-58010382640757823522013-09-18T20:18:38.987-07:002013-09-18T20:18:38.987-07:00:D You are welcome... that was intention of this t...:D You are welcome... that was intention of this trigger.Siddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-38983484058633132462013-09-18T20:17:18.393-07:002013-09-18T20:17:18.393-07:00Thank youThank youSiddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-1638045004370766642013-09-18T16:27:31.931-07:002013-09-18T16:27:31.931-07:00THANK YOU!
As a youn SF administrator, this has h...THANK YOU!<br /><br />As a youn SF administrator, this has helped me SO much.<br /><br />Cheers buddy!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-90019080950602364412013-09-11T01:31:35.167-07:002013-09-11T01:31:35.167-07:00It is very useful for beginners to write the codeIt is very useful for beginners to write the codeprasadhttps://www.blogger.com/profile/18162778429928523257noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-47576672033491630092013-08-17T05:21:51.868-07:002013-08-17T05:21:51.868-07:00Make sure you copy-paste this in a notepad first. ...Make sure you copy-paste this in a notepad first. On HTML pages formating ruins most things.Siddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-44963223304265994432013-08-16T16:14:28.815-07:002013-08-16T16:14:28.815-07:00When I ran this in force.com I got an error due to...When I ran this in force.com I got an error due to the semi colon in id:=theOpportunity.Accountid]. Any ideas?Anonymoushttps://www.blogger.com/profile/16572766263356501433noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-72607285709405582062013-07-03T21:57:47.745-07:002013-07-03T21:57:47.745-07:00Thank youThank youSiddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-33697941012003245882013-07-03T13:48:56.164-07:002013-07-03T13:48:56.164-07:00for begginers,this explnation is very much helpful...for begginers,this explnation is very much helpful......Anonymoushttps://www.blogger.com/profile/04243493039629267428noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-6955481283801304302012-11-30T10:59:45.425-08:002012-11-30T10:59:45.425-08:00Hi Ish,
Thank you for the comment. Well I dont thi...Hi Ish,<br />Thank you for the comment. Well I dont think any question is a stupid question. So let me answer your questions.<br />Q1. The 'The' notation format is Salesforce standard. If you open the source code (Ctrl+u on Chrome) you will see that is how Salesforce gives the IDs to the objects. I am working on Salesforce since the days of S-Control (outdated technology before visualforce) where we used to view source a lot and replicate the thing using JS. The habit is quite stuck. :)<br /><br />Q2. Good point, that should be a lesson to me. I should keep a note. We do not need the other fields, I was thinking of something else before. It happens. Thanks for pointing out.Siddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-13352067383857942942012-11-30T10:52:27.290-08:002012-11-30T10:52:27.290-08:00Thank you, glad it helped.Thank you, glad it helped.Siddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-59671764551307356982012-11-30T07:53:10.797-08:002012-11-30T07:53:10.797-08:00Hello,
First of all thankyou for supporting the S...Hello,<br /><br />First of all thankyou for supporting the SFDC community. I have two questions (may be stupid) but i am quite new to SF.<br /><br />Question 1.<br /><br />Opportunity TheOpportunity = trigger.new[0];<br /><br />after every object you prefix the (is it something standard?) for ex above you have mentioned 'Opportunity TheOpportunity' it seems to be a variable/alias name but do we need to prefix the always? <br /><br />Q2. why have you pulled type and amount in the select query below if you only need name for the account?<br /><br />Account theAccount= [Select Type, Amount, name from Account where id:=theOpportunity.Accountid];<br /><br />can you please shed some light?<br />ishhttps://www.blogger.com/profile/06367596698571743465noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-28367356375605706962012-11-04T05:15:01.762-08:002012-11-04T05:15:01.762-08:00awesome man..........i am new to SFDC.Your explana...awesome man..........i am new to SFDC.Your explanation is so understandable:)<br />veenforce3https://www.blogger.com/profile/13953181439638909114noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-17589969816982153952012-07-22T08:26:34.723-07:002012-07-22T08:26:34.723-07:00Glad it was helpfulGlad it was helpfulSiddhesh Kabehttps://www.blogger.com/profile/05949517024873104589noreply@blogger.comtag:blogger.com,1999:blog-3283225244263709141.post-92106281598650554052012-07-18T02:19:34.147-07:002012-07-18T02:19:34.147-07:00This is super helpful....I would say pretty clean ...This is super helpful....I would say pretty clean and simple....well done...Srihttps://www.blogger.com/profile/12119563501579895648noreply@blogger.com