Developer forum

Forum » Integration » Skip sending recurring order templates to ERP

Skip sending recurring order templates to ERP

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

When I create a subscription it seems that the recurring order template is sent to the ERP (once we run the order sync task, that is). I don't think that's correct behavior as it then creates an initial order followed by the recurring one. If I place an order with a schedule that starts today, I get two orders.

I can skip the submission in OnBeforeSendingOrderToErp myself but would it make sense to add behavior for this in LI? Maybe add a setting like "Skip recurring order templates" and then have something like this in the order handler?

      if (settings.SkipRecurringOrderTemplates && order.IsRecurringOrderTemplate)
      {
        ExecutionTable.Current.Add("DynamicwebLiveIntegration.OrderHandler.UpdateOrder END");
        return new bool?(true);
      }

Imar

 


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I just realized this is very similar to what we discussed last year: https://doc.dynamicweb.com/forum/integration/integration/standard-live-integration-sends-order-to-erp-even-when-the-series-hasnt-started-yet

It think it's just a matter of updating this:

if (!localArgs.CreateOrder || localArgs.Order.RecurringOrderId == 0)

to this

if (!localArgs.CreateOrder || localArgs.Order.RecurringOrderId == 0 || localArgs.Order.IsRecurringOrderTemplate)

I'll fiddle with it and see if I can make it work.

An in the box feature would still be appreciated though :-)

Imar

 

 

You must be logged in to post in the forum