Create Epicor function to calculate workign days back from a given end date

I am working on a dashboard for our high level scheduling views where we look at our standard operations and calculate when they should be done based on a certain days back from the due date. What I would like is an Epicor function that took the due date, and a negative days input, then calculated the resulting operation due date based on the calendar, or some sort of workdays formula. It doesn’t seem like you can do much coding in the Epicor functions though, so I cannot do a code loop to just start moving backwards. It also looks like Epicor doesn’t maintain a table of valid days. I also did not see a service reference that would work from the Production Calendar service. Any thoughts on the best way to accomplish this, or where to start looking?

Are you dedicated tenant or shared tenant. If you are dedicated tenant then epicor functions can be a blank canvas you just have to create a custom code function.

1 Like

There’s a post on here from @hkeric.wci that I’ll try to find.

@jdewitt6029 and @slitzau also have code from something on order entry that I did with @hkeric.wci 's code (it’s either order entry or job entry) that calculates back X amount of valid days from the Need by Date to give a valid required by date to start scheduling the job.

If they have the code, they could post it. Forewarning, I am not an expert at coding so it may be ugly!

-Utah

@Paul_Millsaps

See @hkeric.wci 's code below. You should be able to adapt it if you can use a custom code widget in your function.