Can you create a custom process that you can run on a schedule?
For instance, say I want to create a process that puts a customer on credit hold if there’s an unpaid invoice over 90 days.
I could probably achieve that result when a customer is brought in during Order Entry or something, but I’m curious about the process thing.
Creating custom processes and adding to a schedule are a big task. I have used a work-around like using Windows Task Scheduler with a batch DMT to trigger a BPM that acts just like a scheduled task. Basically, the DMT triggers a checkbox to true according to the schedule in the Windows Task Scheduler. A BPM is triggered on the update of that table / field which then runs whatever process you have and sets the checkbox from step 1 back to false. I have done some items like auto clocking off MES employees this way. Much simpler and you could do this with WCF and/or Rest with a scheduled external program.
The scheduled task thing sounds very interesting. I’ll keep that in my back pocket for the future.
Thanks.
Thanks Dan.
Can you set and then clear the checkbox in the same DMT call?
Company,Key1,Key2,Key3,Key4,Key5,CheckBox20 MC,TRIG,,,,,1 MC,TRIG,,,,,0
Or are two DMT calls (one to set and another to clear the checkbox20 field) required?
I assume Standard Data Directives are preferred over In-Trans. Any reason why an In-Tran DD would be preferable?
And just for curiosity sake, is there a way to detect that the DD was triggered from a DMT?
Here is what I have done in the past.
1 - DMT runs on a Windows scheduled task and updates UD05.CheckBox01 = true, for example, at the scheduled time
2 - A method directive on UD05.Update then fires the real logic (run shipments or MES auto clock off for example). You can also add success or error alerts for the scheduled task in this logic.
3 - The method directive on UD05.Update then set CheckBox01 = false to wait for the next scheduler run
This works great and allows for easy testing by manually toggling CheckBox01 in UD05. I used a UD table for this example but it does not have to be that way. The nice part of using a UD table is that CheckBox01 could be one process that fires and CheckBox02 could be another process that fires. This basically allows then for having multiple custom processes all with the same front-end scheduler. You can also write information back to the UD table like last run time, etc.
Are there any major advantages to using the Update method vs a Data Directive?
There are no major advantages, but more of my preference to avoid a data directive if I can.
I started a test with a DD, triggering on the change of UD05.Checkbox20 from false to true.
The actions are:
- Execute Custom Code - which queries the ShipHead table, sets a DD variable, and displays a message (for debugging).
- Send Email block which uses the variable set in step 1 as the body of the email.
Works fine, triggered from both manual change to the UD, and the DMT execution.
But the message doesn’t display (I wasn’t expecting it to), is there any problem with making a call to show a message box from within a standard DD, that is initiated not by a user?
Pure speculation, but I am guessing the Message Box would be bound to the context and session of the user that initiated it (DMT), so it would not appear. Good question.
I had E10 open when I ran the DMT update, and nothing showed in the E10 session (both were with the same user account).
So it’s not like SysAgent task that can appear across sessions (selecting print preview then immediately closing your sesion, the preview appear the next time a session is launched). And not that I thought it would.
Would the message show up in the DMT logs?