function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SV MSV M 

Create a field called Expiry Date(Date field) on opportunity. Write a batch to get the opportunities whose expiry date is today and send those opportunity details to the email(use custom label for this) and this batch should run every day at 8 am ist

Create a field called Expiry Date(Date field) on opportunity. Write a batch to get the opportunities whose expiry date is today and send those opportunity details to the email(use custom label for this) and this batch should run every day at 8 am ist
ANUTEJANUTEJ (Salesforce Developers) 
Hi Sai,

>> For creating a new field on an object you can just navigate to set up and then to the object and create a new field.

This process is stated in the below article link:
https://help.salesforce.com/articleView?id=adding_fields.htm&type=5

>> As you have mentioned that you want to run it every day at 8 am IST you can use a schedulable apex class that can run at the time you have specified.

Please use the below link which has an implementation of schedulable apex class for your reference.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm

Apart for writing a cron expression you can also schedule an apex job via UI for which you will have to implement schedulable interface.

This is stated in the below article:
https://help.salesforce.com/articleView?id=code_schedule_batch_apex.htm&type=5

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thank you!

Warm regards!
Anutej Poddaturi