BPM to Set PrintAs back to New after Printing

After printing a Purchase Order, PrintAs is set from “N” to “C” automatically. We’d like to disable this behavior and instead only allow PrintAs to be changed to “C” manually.

I put a message box into a Purchase Order Entry customization on the After Adapter Method that should print the name of the method being used. I can’t put my finger on the right event. I also ran a trace log to see if I could pick up on any method being called that was obviously to set PrintAs to “C”.

Does anybody know the correct event that I could tack a BPM to for cancelling this automatic behavior?

Thanks!

In theory, you could use a data directive on PO but would need some indicator (maybe callContextBpmData field indicator) that this was done manually instead of automatically. Another option would be to add a preprocess method directive to Ice.ReportMonitor.Update so that as the report is done processing, it resets the value on the related PO (but can be a bit trickier to find the PO).

I do something like this for mass print. Add a checkbox to poheader that is set in PO.GetNewPOHeader post processing directive to true. if the checkbox is still true when the data directive fires have it set PrintAs to “N”. Your user would have to uncheck and set print as to changed.

1 Like

Thank you both! I think I’ll try to make a “lock PrintAs” checkbox a try and integrate it with BPM logic.

I’m not sure where to start looking for which BO and method updates PrintAs on the PO header; “Update” doesn’t seem to be called when print preview is hit.

It seems like it’s changed by the actual printing process, but I’d rather not tack on logic to the Report Monitor since it’s not related to PO Headers directly. Is there a better place to look?

I’ve listed a few methods below, but they seem to be read only (I would think) so I’m not sure where the value for PrintAs is written.

The method for getting which parameters to use on the SSRS report?

Erp.Proxy.Rpt.POFormImpl
GetNewParameters

return Erp.Tablesets.POFormTableset

I’m not totally sure which one this is
Erp.Proxy.Rpt.POFormImpl
GetRptArchiveList

return System.String

The method to actually put the form onto the report queue?
Erp.Proxy.Rpt.POFormImpl
SubmitToAgent

return System.Void

The method to refresh the menu maybe?
Erp.Proxy.BO.POImpl
GetByID

return Erp.Tablesets.POTableset

This goes on a data directive, which you can see in the image is POHeader.Update and forces the value unless your checkbox is set.

image
my condition
image
my action
image

This is awesome! Thank you for sharing.

The only problem I’ve run into is that the PO Header print doesn’t seem to fire an Update upon printing.

Start
image

Print Preview seems to work to set PrintAs to "C"
image
image

However I did notice that if you close out of the print menu without hitting print, it doesn’t change PrintAs.

To start add the action to an in-transaction data directive to see PrintAs to “N” without any conditions. I made this and printed a few times and PrintAs stays New.

image

Then add the condition if your checkbox is false.

Your method works in my environment for locking PrintAs!

I’m still having problems getting the BPM to acknowledge that the checkbox exists:

BPM:
image

Set Field:

Actual PO Entry shows an update message with the value of PrintAs and the value of the checkbox, which is bound to CallContextBpmData.Checkbox01
image

When I actually print the document, it seems to lose that BPM Call Context data. This screenshot is after hitting “print preview”. The checkbox remains checked, but there was no update message that popped up, and something updated “PrintAs” to “C”.
image

It seems odd that the PO Header Update method would be called but no message box would pop up.

You need to add a UD field to POHeader and regerate the schema. Bind that new field to the checkbox.

In a in-transaction data directive if the new checkbox is false then set PrintAs to N