You need to sign in to do that
Don't have an account?
Class to run monthly to copy data from custom object 1 to new record in custom object 2
Hello all,
Beginner Apex developer here again. Nearly complete with a project and now I need to write a class that I can run monthly with new apex scheduler.
All it needs to do is take data from records in a custom object (all records) and create new records in a second custom object with all that data.
Custom Object 1 = Updates of MTD live data from our phone system for each sales rep.
Custom Object 2 = Month end snapshots for historical tracking puposes.
I'm sure there is an easy way to do this, but with my limited knowledge I'm not sure where to start. If some kindly developer could point me in the right direction, I'm sure I can put the pieces together.
Hi David,
Have you considered using Analytic Snapshots for that? It's fairly effective if you're not grabbing more than 2000 records to snapshot. If you're managing more than 2000 sales reps, I pray for you.
All Answers
Hi David,
Have you considered using Analytic Snapshots for that? It's fairly effective if you're not grabbing more than 2000 records to snapshot. If you're managing more than 2000 sales reps, I pray for you.
Hadn't looked into Analytic Snapshots, but will give it a go and post back if it won't work for what we need. We just started using Salesforce so I'm learning a lot very quickly. Currently our sales team is about 25 reps. I don't see it going any where near 2000 any time soon.
Analytic Snapshots looks perfect! Thank you.
The only issue I can find it trying to set the owner of the new record. The source object has an owner and another lookup field to set the user that is being reported on.
When I create a report to feed the snapshot though, I can't set anything to populate the Owner of the new record. I see "(No fields with compatible data type)".
And, of course, I can't use an insert trigger or workflow rule to set this either.
Am I missing something painfully obvious here?
Hi ,
I have the same requirement. Could you please send me the sample code for this requirement.
Thanks,
satya