Triggering Code on Start and End of a Promotion

Vote:
 

Hello

Is there a way for me to run custom code on start and end of a sale?

#325910
Jul 23, 2024 18:31
Vote:
 

Hi Peter,

I am not sure about your question. You mean that you want to listen event and add some your custom code once a promotion start date comes and promotion end date comes, right?

#325996
Jul 25, 2024 9:10
Vote:
 

Hi Binh

Yes, I'm looking to listen to an event and run custom code onStart and onEnd.  

#326006
Jul 25, 2024 17:12
Vote:
 

I am afraid that there is nothing like this by default. I suggest that you can create a new scheduled job for it. Your scheduled job will scan promotions and find out active and expired promotions in the day. It should be scheduled to run once a day

#326042
Jul 26, 2024 5:25
Vote:
 

No, content is silenty published and expired. You can check your preconditions during the loading of the promotions. If those are met, then run the code. As long as the preconditions are efficient to run, this approach rarely becomes a problem..

#326102
Edited, Jul 27, 2024 9:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.