Looking to write a “simple” post processing method against Erp.BO.Part.GetNewPart which checks that the Part.TypeCode = ‘M’, if it meets this condition it then updates PartPlant.PrepTime with ‘30’ and PartPlant.KitTime as ‘10’.
I’m very new to using the Update Table by Query widget, and have only used it in a data directive, would this be best way to achieve these results please? I’ve started to build it but have got stuck on trying to set an expression on both PrepTime and KitTime, unsure what expression to set a field.
Thank you so much for your help. We’ve now applied this to ERP.BO.Part.Update instead.
We ended up switching to a pre-processing method which checks for TypeCode = M and some other criteria, which works. Then we added a ‘Enable Post Directive’ widget for setting the fields.
The bit that isn’t happening, is in the post process, it just will not update the PartPlant fields. We have even tried removing all conditions and doing a simple Set Field widget on PartPlant.PrepTime but it just will not update… it’s almost like a different method is happening at the point of saving the part
You said the goal was for this to fire on new part entries correct? In your MicTest pre-processing directive, you have the conditions looking for “the updated row” if you click on that you will see a list of options. From my understanding Added Row should be new rows, Changed Row would be added or updated, and Updated Row would only be updating an existing row. I’ve also found this to be a little unreliable which is why I try to include the rowmod as a condition.
I would also suggest adding in some show message widgets to verify what is firing and what isn’t.
If you’re unsure of what method is happening, you should check the dev tools in the browser and watch. Check out this post from @hmwillett for more details on that How To: Debugging Kinetic (Browser)
Thanks Cory!! Sorry to ask another, how do you set RowMod == A, is there an expression editor I’m missing or a specific condition you pick from this condition drop-down please?
Also since all you want to do is set 2 fields, I would just do it in the pre-processing directive. I use the enable post processing when I’m concerned that whatever I’m going to do will take enough time that the user would notice the save time is slow. So if I’m pulling a bunch of variables to put into an email and send, I’ll enable a post processing and do the email there. Setting two fields wouldn’t make a significant impact on the save time (I wouldn’t think), but obviously you can test it and if you can get it working in one pre-processing bpm, you can then work on moving that part to a post-processing one.
Thanks Cory, this has been super helpful!! We’ve added in the extra condition, and changed the condition criteria to ‘changed’. When adding a message box to the end of this, it worked when creating a new part and was able to see the message.
It looks like you’re coming off the false side of you’re condition, the bpm editor isn’t always super clear where the lines are going, but make sure you drew that connection from the true side (on the left) to your set field.
I might have been wrong about doing it all in pre-processing. Since you’re doing this when adding a new row, there is no PartPlant record for this part at this point in the method. It will get created as part of the base processing.
Now that you’ve got the condition working, go back to enabling post processing and try setting it there.
It looks like a PartPlant record is not available in the Update unless one of the fields being updated is in a PartPlant record. With this info message, asking to show the PartPlant.Plant, it will be blank unless I actually modify a PartPlant field:
Ah yes! Thank you so much for looking at this! So I just tried this out by changing the purchasing min order qty, and the BPM fired/updated the Prep Buffer field to 222 as it was a change on the Part Plant record like you said.
I’ve been doing some testing on setting the field as a post process but it doesn’t do it there either. The only place it actually does update is when we do an In Transaction Data Directive on PartPlant, but then we lose the condition from the Part table
We almost need it so that we set the condition on the part.update pre-processing, then somehow bring this into a data directive against the partplant