Salesforce coding lessons for the 99%
Finally, Apex tutorials for point-and-click admins! Written by a self-taught Google engineer.
  • Beginner Tutorials
    • Apex
    • Certifications
    • Career Info
    • Technical Architect
    • Visualforce
    • Videos
  • Apex Academy
  • Success Stories
  • About Me
  • Misc
    • Mailbag
    • Challenges
    • Links
    • Login to my Org
Follow @dvdkliuor SUBSCRIBE!

To everyone who has viewed SFDC99 today (Christmas)

December 25, 2014

You are either:

  • Crazy dedicated to learning Apex
  • A robot

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.

Thanks in advance

Reply
    David Liu
    January 21, 2015 @ 6:48 pm

    Easy solution: use a workflow!

    Reply
      nb
      January 21, 2015 @ 9:43 pm

      No , I have to do it only using After Insert Trigger.

      Reply
        David Liu
        January 21, 2015 @ 9:45 pm

        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!

        Reply
          nb
          January 21, 2015 @ 10:51 pm

          Actually that was a challenge given to me.
          Yes you are right , I should not work on all these things
          Thanks.

          Reply
            Volodymyr Antoniuk
            January 21, 2015 @ 11:07 pm

            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;

            )

            Reply
              David Liu
              January 21, 2015 @ 11:09 pm

              You are the first person to actually use the <code> tags!!!!!

              YES!!!!!!!!!!!!!!!!!!!!!!

              (and thank you for the code as well!)

              Reply
                nb
                January 23, 2015 @ 5:05 am

                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.

                Reply
                  Volodymyr Antoniuk
                  January 23, 2015 @ 5:11 am

                  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

                  Reply
Anonymous
December 29, 2014 @ 4:52 pm

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!

Reply
    David Liu
    December 29, 2014 @ 5:22 pm

    Cheers and GREAT job!

    Reply
Sudipta Deb
December 27, 2014 @ 2:00 am

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.

Reply
    David Liu
    December 27, 2014 @ 12:56 pm

    I’ll be cheering for you this year!

    Reply
sfdc learner
December 26, 2014 @ 3:03 am

Wish you a Very Happy Christmas to you and your family!

Reply
Dilip
December 25, 2014 @ 8:55 pm

Merry Christmas David!!!(my SFDC guru).
http://e.3875.com/christmas/em2.html?stra=Dilip

Reply
Prasanna
December 25, 2014 @ 8:49 pm

Merry christmas david

Reply
Anonymous
December 25, 2014 @ 7:45 pm

Merry Christmas David (my guru:-)

Reply
Nagarjuna
December 25, 2014 @ 5:06 pm

You are amazing David!!

Merry Christmas bro!!

Reply
Sudarshan
December 25, 2014 @ 2:39 pm

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!

Reply
    David Liu
    December 25, 2014 @ 2:56 pm

    I’ll be cheering for you this year Sudarshan, Merry Christmas!

    Reply
kurunve
December 25, 2014 @ 1:07 pm

Merry Christmas to You Too!

Reply
Agnes
December 25, 2014 @ 12:17 pm

David, Merry Christmas and a very Happy New Year to you and to your family!

Reply
Anonymous
December 25, 2014 @ 12:13 pm

You are the crazy one to login to your website today!!! Hehe.. Merry Christmas..

Reply
    David Liu
    December 25, 2014 @ 4:06 pm

    Guilty! =P

    Merry Christmas Anon!

    Reply
Sophie
December 25, 2014 @ 11:54 am

Merry Christmas to you and your family David!

Reply
Sompalli HariKrishna
December 25, 2014 @ 11:49 am

Merry Christmas David!!!

Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


*

*

Theme: Simple Style by Fimply