Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #-----------------------------------------------------------------------------------------
  2. # Company:     Certus Solutions  
  3. # Name:        FLD.SRVRECTRANS.POLINENUM.ACTN
  4. # Description: Service Receipt Purchase Order Line Number Action
  5. #
  6. # Information:
  7. # ------------  
  8. # Toggles the details section of service receipt table  
  9. # if one of the commodity group or code fields is empty
  10. # after selection of ordered line item so commodity details
  11. # can be entered.
  12. #
  13. # Launch Point(s):
  14. # ----------------
  15. # Object:      SERVRECTRANS
  16. # Attribute:   POLINENUM
  17. # Event:       Action
  18. #
  19. # Revision History:
  20. # -----------------
  21. # 11-APR-2023 - JPAVLESKI - Initial creation.
  22. #
  23. # @author Jamie Pavleski
  24. #-----------------------------------------------------------------------------------------
  25.  
  26. service.log("!!! ==================== " + launchPoint + ": START =====================")
  27.  
  28. #-----------------------------------------------------------------------------------------
  29. # Toggle the details section of the service receipts table for required attributes
  30. #
  31. # @param open (Boolean) - True open detail section, false close detail section.
  32. #-----------------------------------------------------------------------------------------
  33. def toggleServiceReceiptDetail(open):
  34.                              
  35.     # Get web client session
  36.     uiContext = service.webclientsession()
  37.                                      
  38.     if (uiContext is not None):
  39.         # Application instance
  40.         appInstance = uiContext.getCurrentApp()
  41.                                          
  42.         if (appInstance is not None
  43.             and appInstance.getApp() is not None
  44.             and appInstance.getApp() == "receipts"):                                                
  45.             # Service receipt table bean
  46.             matlReceiptTable = appInstance.getDataBean("servreceipts_servreceipts_table")
  47.                                                  
  48.             if (matlReceiptTable is not None):
  49.                 matlReceiptTable.toggledetailstate(open)
  50.                                      
  51. if (mbo.isNew()
  52.     and mbo.getPOLine() is not None
  53.     and mbo.getPOLine().getBoolean("issue")
  54.     and (mbo.getPOLine().isNull("commoditygroup") or mbo.getPOLine().isNull("commodity"))):
  55.     toggleServiceReceiptDetail(True)
  56.          
  57. service.log("!!! ==================== " + launchPoint + ": END =======================")