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
The new LearnerThe new Learner 

How to Update events using batch class

Hi Experts,

I want to post a chatter on the event record on a daily basis when the event status-completed and When the Event Date is passed. Chatter should not update the same record in their next batch . Kindly help me out.
PriyaPriya (Salesforce Developers) 

Hi,

This is really hard to follow. Can you please provide a little more description of it.
Also as per my understanding you can try the below approach.

suggesttion - Process buildet to post chatter 

https://webkul.com/blog/post-chatter-feed-apex/#:~:text=Apex%20Code,-public%20class%20chatterpost&text=As%20you%20can%20see%20here,posted%20to%20your%20own%20profile.

The new LearnerThe new Learner
Hi Priya,

I need to post a chatter on event records on daily basis using batch class based on the below criteria.
1.  When the Event record is status completed.
2. When the Event Date is passed.

Again it should not query the records which already chatter is posted using our batch class.

 
PriyaPriya (Salesforce Developers) 

You can create one custom field of checkbox type. Its intial value will be false.

So in Process builder you can check if the checkbox is false and status is completed and date is passed, the do the action 

In action :-
 1. chatter post
 2. update the customr field (which you have created above) to true.
so that next time that record get filter out. 

Hope this information will help you. If yes then you can mark it as best answer. 

Regards,

Priya Ranjan

The new LearnerThe new Learner
How can schedule it daily, for the records