Skip to main content
Solved

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

  • October 22, 2024
  • 6 replies
  • 69 views

Forum|alt.badge.img

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.

 

Best answer by lauraj46

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

View original
Did this topic help you find an answer to your question?

6 replies

Forum|alt.badge.img

Anyone has suggestion?


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 579 replies
  • October 24, 2024

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

 


Forum|alt.badge.img

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


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 579 replies
  • October 24, 2024

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


Forum|alt.badge.img

@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?


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 579 replies
  • Answer
  • October 24, 2024

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings