Developer forum

Forum » Development » Stop Recurring order for selected months

Stop Recurring order for selected months

Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

HI

I have  requirement that needs to give customer a option to stop reccuring order for some months.

eg: order will be from january to dec for every months, and customer does not want that order to happen in april and august.

what will be the best way to achive it

Thanks

Shiwanka


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Shiwanka,

 

It depends on how you manage that.

 

If this is a one off, maybe just with a notification subscriber that simply deletes the order after it's been generated. You can even have a specific order state for it, so you'd get some sort of auditing in the future to know that the April order was generated, but then "Cancelled".

 

Now whether that's hardcoded or in some custom sql table, you would need to embed in the notification subscriber the logic to cancel/delete the orders.

 

Best Regards,

Nuno Aguiar

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Thanks Nuno for reply

is there anyway i can stop order creation from BeforePlaceRecurringOrderArgs  ?

if i stop recurring process is going to retry?

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Shiwanka,

 

Looking at the code (in DW9 at least) and I'd say no. That notification is called when the recurring order "template" (the base order that will be used to create all future orders) is created. It's not triggered when a new order (from a recurring template) is created, as far as I can tell.

 

And I haven't tested it that much, so you'd have to try.

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Thanks Nuno

 

You must be logged in to post in the forum