You need to sign in to do that
Don't have an account?

Need help with Apex Service class? I will give kudos to anyone that contributes.
I've never built a Apex Service.... Below is a description of what I'm trying to do. I will give kudos to anyone that contributes.
Do you have any info on Apex Services?
What I need is a way to look at the contracts and create a new contract 60 days before the previous contracts end date.
I have the code that will build the follow up contract, what I don't have is a way minus using Time Based Workflow to query all contracts that are in the window of renewal of Maint or expiration and create new contracts for those that are 60 days out from expiration.
Any ideas?
Thank you,
Steve Laycock
Hello Steve,
I am not sure if I have got the requirement right but here is what I think you can do:
You can schedule an apex class to run everyday and query (SOQL) the Contract records whose expiry date = System.TODAY() + 60
For all the records retrieved, you can create a new contract for them.
Please go through the below link to schedule a class:
www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
All Answers
Hello Steve,
I am not sure if I have got the requirement right but here is what I think you can do:
You can schedule an apex class to run everyday and query (SOQL) the Contract records whose expiry date = System.TODAY() + 60
For all the records retrieved, you can create a new contract for them.
Please go through the below link to schedule a class:
www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
Thank you very much Sandeep.
Steve Laycock