Automating ShipBy Date to Previous Friday

Has anyone had any luck determining a method to evaluate a sales order NeedBy date and then having the workflow assign the ShipBy date to be a previous date, such as the Friday before? Starting down this rabbit hole and wondered if anyone had attempted such a thing before.

I use a combination of bpms and the SOA workflow to make changes.

I have a condition that the data directive is called by the integration user.
image

This is a piece of the C# that sets the RequestDate offset by DemandDeliveryDays, but you could also find the previous Friday and set it.

if (ordData != null)
  {

    ttOrderDtlRow.RequestDate = ttOrderDtlRow.NeedByDate?.AddDays(-ordData.DemandDeliveryDays);
    ttOrderDtlRow.RequestDate = CheckDate(ttOrderDtlRow.RequestDate.Value, noWorkList);

  }

Not that it helps in the near-term, but there is a new feature coming in 2024.1 update that may help… Not sure what version you’re on.

1 Like

This is quite nifty! Fortunately, I was able to figure out how to accomplish my goal with the default tasks available within ECM. After the PreCheck, I used a combination of Advanced Format, Substring, Advanced Math, Math, Set Field Groups and finally Create Subgroup to create, calculate and assign my new ShipBy dates.

The key once I had the values was to be sure to account for it in the Create Sales Order step as by default the @OrderRel_ReqDate field is not populated.

1 Like

Good to know! As mentioned, this won’t help in the short-term, but certainly once Kinetic 24 is released. The Delivery Days field has always bothered me because it is such a universal requirement that is useful for EVERY customer using Epicor, but it was only available for contract customers, which required the Demand Management license. Glad they’ve made it available without the license.