Merry Christmas and don’t forget to think of your loved ones today!
And if you don’t have any family to celebrate with today, I consider you to be part of mine.
Merry Christmas my Salesforce family!
David
26 Comments
nb
January 21, 2015 @ 4:12 am
HI David
I have a question :
I have an object name with two fields : first name and last name.
now when i enter first name , the field last name should get copied with first name.
I have to do this using after trigger.
In that case, I assume that you should use next useful lines of Code:
List updated_objects = new List();
for(Custom_Object__c obj : trigger.new){
Custom_Object__c updated_object = new Custom_Object__c(Id = obj.id, LastName = obj.FirstName);
updated_objects.add(updated_object);
}
upsert updated_objects;
That will allow you to modify trigger record in after insert trigger
Feel free to put your questions/ideas/objections
(but again, I am thinking that it should be Workflow rule or at least before insert trigger – in the case in the loop you will just write
obj.LastName = obj.FirstName;
)
Got 2 certifications and 2 Salesforce-related jobs this year (one in house, the other consulting). Here’s hoping 2015 holds more successes in store for the both of us!
Merry Christmas David. Believe me, I am a big fan of your blog posts. All your posts are really helpful and inspiring. My goal for 2015 is to complete ADM 201, Advanced Administration, Sales Cloud, Service Cloud. Let’s see how much I can achieve. But thanks again for all your help and inspiration.
Really appreciate the service you are doing to the learning society, David! You have been my biggest inspiration since when I have discovered sfdc99.com. My new year resolution for 2015 is going to have to be to complete all the certifications that do not need coding and at least one that does. Wish you a Merry Christmas and a Happy New Year 2015.
Keep spreading the love!
HI David
I have a question :
I have an object name with two fields : first name and last name.
now when i enter first name , the field last name should get copied with first name.
I have to do this using after trigger.
Thanks in advance
Easy solution: use a workflow!
No , I have to do it only using After Insert Trigger.
Why a trigger? And why an after trigger? If anything, it should be a before trigger!
I don’t want you to get into bad habits early in your career!
Actually that was a challenge given to me.
Yes you are right , I should not work on all these things
Thanks.
In that case, I assume that you should use next useful lines of Code:
List updated_objects = new List();
for(Custom_Object__c obj : trigger.new){
Custom_Object__c updated_object = new Custom_Object__c(Id = obj.id, LastName = obj.FirstName);
updated_objects.add(updated_object);
}
upsert updated_objects;
That will allow you to modify trigger record in after insert trigger
Feel free to put your questions/ideas/objections
(but again, I am thinking that it should be Workflow rule or at least before insert trigger – in the case in the loop you will just write
obj.LastName = obj.FirstName;
)
You are the first person to actually use the <code> tags!!!!!
YES!!!!!!!!!!!!!!!!!!!!!!
(and thank you for the code as well!)
Hi David ,
Please help me with this question :
How to handle this error : Methods defined as TestMethod do not support Web service callouts, test skipped.
I have no idea as i am new.
there are a lot of well-written articles about how to test web callouts in salesforce
for example
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_wsdl2apex_testing.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_testing_httpcalloutmock.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_testing_static.htm
Feel free to put more questions if something is not clear
Merry Christmas and Happy New Year!
Got 2 certifications and 2 Salesforce-related jobs this year (one in house, the other consulting). Here’s hoping 2015 holds more successes in store for the both of us!
Cheers and GREAT job!
Merry Christmas David. Believe me, I am a big fan of your blog posts. All your posts are really helpful and inspiring. My goal for 2015 is to complete ADM 201, Advanced Administration, Sales Cloud, Service Cloud. Let’s see how much I can achieve. But thanks again for all your help and inspiration.
I’ll be cheering for you this year!
Wish you a Very Happy Christmas to you and your family!
Merry Christmas David!!!(my SFDC guru).
http://e.3875.com/christmas/em2.html?stra=Dilip
Merry christmas david
Merry Christmas David (my guru:-)
You are amazing David!!
Merry Christmas bro!!
Really appreciate the service you are doing to the learning society, David! You have been my biggest inspiration since when I have discovered sfdc99.com. My new year resolution for 2015 is going to have to be to complete all the certifications that do not need coding and at least one that does. Wish you a Merry Christmas and a Happy New Year 2015.
Keep spreading the love!
I’ll be cheering for you this year Sudarshan, Merry Christmas!
Merry Christmas to You Too!
David, Merry Christmas and a very Happy New Year to you and to your family!
You are the crazy one to login to your website today!!! Hehe.. Merry Christmas..
Guilty! =P
Merry Christmas Anon!
Merry Christmas to you and your family David!
Merry Christmas David!!!