You need to sign in to do that
Don't have an account?
force developer 35
Create Batch apex class to create Opportunity records based on Contact Data
I am completely new to Apex and coding.I have a requirement where I need to create Opportunities for Contact objects when a Picklist field on contact object gets updated.
Which means when the picklist filed is having any of the following values then an opportunity should get created for that contact automatically...
My picklist field values are: Service every year, Service every 6 months, Phone call and Send mail.
Now I need some help in writing the batch apex class and test class for this requirement. Any help is much appreciated.
Thanks in advance.
Which means when the picklist filed is having any of the following values then an opportunity should get created for that contact automatically...
My picklist field values are: Service every year, Service every 6 months, Phone call and Send mail.
Now I need some help in writing the batch apex class and test class for this requirement. Any help is much appreciated.
Thanks in advance.
Use this batch class this will help you, and you can modify picklist values according to you. If you found it useful please appreciate my efforts and mark it as the best answer.
LinkedIn: https://www.linkedin.com/in/soyab-hussain-b380b1194/
Regards
Soyab
All Answers
What do you need batch class OR Contact.Trigger ??
I need a batch class which runs every quarter.
I also need to check one more picklist field value on contact object before creating the opportunity.
The second picklist field name is Contact Month
Use this batch class this will help you, and you can modify picklist values according to you. If you found it useful please appreciate my efforts and mark it as the best answer.
LinkedIn: https://www.linkedin.com/in/soyab-hussain-b380b1194/
Regards
Soyab
Have you created the test class for the above scenario, if you have it now could you please share it. I have also a same requirment and needs to write the test class for it