I am in 10.0 currently and trying to make a BPM for force a PO line for a part to be buy direct to job only. I’m working with a method directive pre-processing. The first conditions I have are by Product code on the part, and whether or not the part is set to stock or non-stock, that works fine.
What I can’t figure out is how to get whether or not the line is to be set as a buy direct or to inventory. The database stores that information in the PORel table, but the temporary table isn’t populated in the pre-processing method, so I have to move to the post processing to test a valid condition. But at the post processing level, throwing an exception doesn’t stop the save because it already happened.
I know that I am missing something simple, but I’ve been banging my head trying to figure this out without help, but I’m stuck.
I’m looking at E9, but I’m sure E10 is the same. There’s not a database field, but there is ttPODetail.CalcTranType that would have the transaction type. This should be available pre-processing, and is what would eventually populate to PORel.TranType.
That should work for you. Another trick I use when there are challenges with the PORel table, is to NOT edit when the record is being saved, but to read through and prevent the user from approving the PO. You should be able to edit here because there’s a CalcTranType at the detail level, but if you were working with other fields, keep the other alternative in mind.