Got an interesting issue happening and I’m not entirely sure what the fix is, it seems like I’m doing everything right? So as part of a customization we are doing, we set up our UD02 table as kind of a label printing queue - basically any time a record goes into that table a data directive triggers an auto print request that handles some specific types of label printing we handle on site.
In our PartTran table, we have a data directive set up that under a specific scenario will insert a new record into UD02 with the intention of triggering a label print automatically. However, when this PartTran directive runs it is putting the record into UD02 but the UD02 directive does not seem to be firing at all.
Below are the screenshots from my PartTran data directive showing the BO methods used for GetANewUD02 as well as the Update method, as well as some Custom Code that’s there to set a few values before sending it over to UD02.
I’ve confirmed that this code is getting hit and data is making it to the database, however the data directive on UD02 is never being activated. Is there something I’m missing here to get the second data directive to trigger? Thank you
like others said, putting a data directive in part tran is a bad idea. You should find the programs that you actually want this to fire for and do this as method directives there.
You should use the BO to make the updates, and then your other BPMs should fire. Going direct to the DB is going to bypass some stuff.
I removed Db.validate() and the same thing still occurs (or doesn’t occur, in this case?)
I should also clarify - this PartTran data directive is a Standard one, not an In-Transaction directive, and outside of writing to UD02 it’s only used for a few various other auto prints that we need.
I’ve tried setting RowMod to both A and U and neither seems to change the end result of the UD02 data directive not triggering.
And for the sake of just seeing if it would work, I even set up my PartTran data directive to get the UD02 record I just created again via GetByID, update one of the number fields I wasn’t using, and pushed an Update back to that record in UD02 to see if the directive would fire there and it still didn’t go.
The UD02 data directive is just a Standard directive as well, not an In-Transaction one.
Yeah, I quickly set up a form on the UD02 screen to manually insert them there and that seemed to go through perfectly fine. So it’s specific to the PartTran data directive
There’s a few conditions within the UD02 directive depending on what values are entered into a couple of fields, but those don’t seem to be impacting the functionality of it at all. I temporarily set up that directive to send me an email as the first thing it does regardless and that wasn’t even being sent when I tried triggering it from PartTran.
Apologies if you’re referring to some different conditions I might not be aware of.
If a BPM fails down the line, many times it doesn’t complete anything. Try a brand new empty BPM just to see if you can get something firing.
A wild ass guess is you might need a buffer copy. That’s a copy of the same row with no row mod. Usually it’s when you’re looking for changed rows. As to know if it changes, it compares the 2 rows.
But just trying to guess from one partial screen shot is pretty tough, so that’s about all I got for you. I would recommend documenting your whole process to post, then someone might be able to spot your mistake.
I know I’m beating a dead horse, but I would also recommend trying to offload this to not part tran. Even if you aren’t “doing” anything with it. It still has to check those conditions every time a part tran record is created. And that’s A LOT. But you do you I guess.
I’ll try a buffer copy and also an empty BPM as well to see if that helps shed any light.
Also sorry about the incomplete screenshots - I was trying to relegate things to the specific area I was working on.
I don’t know if it helps at all, but I was using email alerts as kind of triggers for where I was at in the process of each directive and it seemed to get all the way through the PartTran directive but not anything in the UD02 one.
EDIT - Would a duplicate/buffer row even be possible? Wouldn’t that run into a primary key issue with Key1?
I would move the part tran UD record creation into a Function and test.
If it works from the function then call the function from your part tran DD. If that then fails again change the function call to async to break the chain.