I am new to SalesForce. My goal is to create a scheduled Apex function that runs once all 24hours that just copies Account.Field("field1").Value to Account.Field("field2").Value. Is there a good example code page or tutorial to do this?

  • Is there a reason you don't want to do this realtime with a trigger? Do you want to do this for every account? – pchittum Jan 24 '13 at 16:29
  • yes, it should only be all 24 hours using the "schedule apex" function. And yes it should be for every account. Background: I have a data_today field and a data_daybefore field. I just want to save a copy of todays data to a separate field so I can compare my data with that on the day before – user670186 Jan 24 '13 at 16:36
  • @user670186 For learning the apex workbook is better if you are new to force.com platform – Mohith Shrivastava Jan 24 '13 at 16:51
  • An alternative to this could be to turn on Field History Tracking. – Daniel Hoechst Jan 24 '13 at 20:30

This requirement for you is good exercise as a fresher.

Please use the trailhead module to explore scheduled job and batch apex


  • Thanks you! The examples are very generic though, I will try – user670186 Jan 24 '13 at 17:42
  • 1
    Documentation is not available anymore – paranza Apr 30 at 10:16
  • @paranza Thanks for pointing out i just substituted with trailhead modules . – Mohith Shrivastava Apr 30 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.