Create a Warning if Selected Ship By Date is Holiday

Hi everyone,
I am trying to create a customization, which will pop a message if user select a specific date (for testing I put a condition today). Now I tried to add more condition, adding more non working date on the rule value but it gives an error during compilation.


The condition for today works:

image

Can someone give some insight on this please. Thanks

I would NOT put this in the UI customization, but rather would create a BPM that would monitor the data on save. Better yet, create a function to do it, and then call the function from other BPMs so you could use the same logic for checking Quotes, Order Header, Order Dtl, and OrderRel… even use it for POs if you like if it is a function. The function could simply have a date as an input, and then return if it is a working date or a weekend or a holiday.

2 Likes

Thanks @timshuwy . I will read about this and do testing. Thanks.

I second what Tim said, we needed to do something similar (though it was for an SSRS report) and figured out it is something you’ll probably want in a table which contains the holidays. Especially since a company holiday might be different than a calendar holiday. We loaded the our table with the days the company wouldn’t be doing business rather than the actual holiday dates.

turning on the “wayback machine”… I remember in my early programming days, I had to create a scheduling system… being the lazy programmer I was, I simply created a big table… one entry per work date… the table had two fields. The DATE and a SEQUENTIAL “MDATE” date that was auto sequenced (and resequenced if dates were added or removed.
THEN I could simply look up any date on the calendar and if it wasn’t a date, I would get the NEXT one… Once I had a date, I could retrieve the MDATE… now, if I wanted to know the date that was 10 working days away, I could simply add 10 to the MDATE, and lookup that MDATE to find out the related calendar date. This worked really well, because it doesn’t take any counting of days (but the table does need resequenced with each new /deleted date).

1 Like

Mine was simpler, just load the holidays into a table (there’s not all that many work holidays for our company) and bounce a date off it. Mostly all we were looking at was how many actual days were worked in a given period for cost/price analysis. The drawback being that we have to manually add the holidays to the table when we get the holiday schedule. (which I will have to do again in a few months once we get the 2023 schedule)

1 Like

@chemuelmardie Here is an approach using the production calendar.

https://www.epiusers.help/t/adjusting-for-holidays-weekends/44599/11

1 Like