Skip to main content

Is it possible to automate the printing of production label with help of business event?

I’m trying to automate label printing from production order details screen when certain operation status got changed to completed.

 

Anyone has suggestion?


Hi @ranjithduraisamy72 ,

My thought would be to create an action (in a customization) to print a label with the DeviceHub.  See this post for help on the code to print a report to Device Hub.

Once the action has been created, use a business event with an “Action Execution” subscriber to trigger the label printing.   

Hope this helps!

Laura

 


Thanks for the reply Laura, But we dont have option to use production order details screen in business events, do you have any suggestion on this


Hi @ranjithduraisamy72 ,

I could suggest creating a generic inquiry that selects the records for printing.  The DAC that contains the operation status is AMProdOper.  Publish the generic inquiry and then it can be used as the screen for a business event.

Laura


@lauraj46  I did the same, but I got an error and that is not processing. Along with the business event, Should I wants to add that piece of code?


Hi @ranjithduraisamy72 ,

Yes, you will need to add some code to extend either the ProdMaint or ProdDetail class.  Once you have published that customization project then you should have the Print Label action available on the Production Order Maintenance or Production Order Detail screen and you can test it manually from that screen.

Here’s another thread with some sample code that is an example of the code for the class extension.  I think there was a change at some point made to the CreatePrintJob function which adds an extra argument, so you may need to adjust the code slightly.

Once the action is working and published, the next step would be to create the generic inquiry to select the production orders for printing.  Depending on your requirements, you might just be able to use the Production Order Details screen with a filter.  Create a subscriber of the type Action Executions.  Choose the Action Screen ID to be the screen where you added the new action.  Your new action should be there to select. You will need to specify the keys so that the action is executed for the right production order.

Hope this helps!

Laura


Reply