Hi All,
Trying to get a BPM to fire if the part revision on the part isn’t approved on a PO to warn the purchaser.
I have been able to get it to populate the warning, but it doesn’t matter if the revision is approved or not.
I created a directive on the PO detail table with a condition for the number of rows in the myquery (partrev approved = false) is more or equal to 1.
Any help is much appreciated.
@Jennifer You need to give the query the part and rev to lookup.
First assign Part and Rev to variables with Set Argument/Variable
You don’t want to check on every update. Only when the Rev changes so add another condition.
You could join to the ttPODetail, but that is bad, so we will use the variables Part and Rev to find if the Revision is approved. I also added that Rev was not blank. Not sure if it is needed.
Ah nice one Greg. I didn’t even get chance to import it into an environment as yet.
@gpayne I’ve never had an issue with joining to tt tables, queries always seem to run quick. Have you had personal experience with poorly performing queries, or just heeding the advice that’s been written in a couple of forum posts? Just intrigued .
@markdamen I have not either, but when posting publicly I want to not show any possible bad habits. I actually did the joins to tt and tested this and heard a voice about the tt issue and I went back and did it with variables. With a small table just bad form, but with something like PartTran or TranGLC it could be very bad.
HI @gpayne and @markdamen,
First, I want to thank you so much for the guidance and let you know that I appreciate you! You guys rock!
The is warning still generated even if the part revision is approved.
I guess I should have mentioned that the parts have multiple revisions and we only want to trigger the warning if the revision chose is not approved. I’m also not familiar with the variables, so am wondering if i have something set up on the action.
In Greg’s screenshot he has Approved = true, you want Approved = false I think. Is it currently NOT firing when it should (i.e. the reverse of your desired behaviour)?
I would move to using a Method Directive on the PO.Update method. Use pre-processing, then you have the choice of either a warning or a block.
Use the same template that Greg provided, make sure to use “Set Field/Variable” block once for each variable. I confused you in my previous reply, I spotted that Greg used a check for query rows less than 1 so his TRUE would work.
@Jennifer The way I posted looks for the rev to be approved and sets the warning if the revision is not approved and MyQuery returns 0. That is why number of rows is less than 1. What is your version you just have E10. I have a 10.2.400 and can send you a working version if you are 10.2.400 or better.
HI Greg,
Using version Kinetic 2021.2.33. If you could send it, that would be fantastic. At this point I’m not sure if it is the version or something I am doing incorreclty.
Thanks so much again!!!