Search code examples
event-handlingpowerbuilder

Powerbuilder 7.0 - Pass value from an event to another event


i'm currently using Powerbuilder 7.0. So i got an object that need to modify 2 events. It is an inventory program, which will check if the item are below the level, it will pop out a message to show current available qty and reorder level qty.

So event stock_reorder_level are for displaying the message, and event stock_checking are for the checking of stock qty. Now i've done the message, but it shows 0 for available and reorder qty. The value for the qty are defined on event stock_checking, i wasn't sure how to pass the value of qty to the stock_reorder_level event. Below are some of the coding i've done.

event stock_reorder_level

event stock_checking

My question: how to pass dec_totPrdQty and dec_stockReorderLevel to event stock_reorder_level.


Solution

  • You need to:

    • Add adec_prdqty and adec_reorderlevel as parameters to the event definition for stock_reorder_level instead of the two local variables.
    • pass the two values as arguments when you call stock_reorder_level. EX:

      THIS.EVENT ue_reachStockReorderLevel(al_row, dec_totPrdQty, dec_stockReorderLevel)
      

    You toggle the event definition in PowerBuilder's script painter with the button "Show/Hide Prototype" located in the top right-hand corner.