info window evaluate wrong logic when un-selected parameter
Description
Create a Purchase Order, then complete it (example Purchase Order ID = 10000).
Create a Material Receipt header
Click “create lines from“ to open the “Create lines from Shipment/Receipt“ info window
In the Order parameter, select the Purchase Order created in step 1 => the Invoice field becomes invisible, and a row is selected.
Clear the Order field => the result shows no records, but the Invoice field is still invisible
Reason:
The invoice display logic depends on the order (… &@C_Order_ID@=0) and uses InfoWindow.infoContext as the context for evaluation. If infoContext is not provided, it falls back to Env.getCtx by default
In step 4, when selecting a purchase order, the flow proceeds as follows:
The parameter value of C_Order_ID is stored in InfoWindow.infoContext by call valueChange
The display logic of the Invoice parameter is evaluated using InfoWindow.infoContext as the context let it invisible
It performs a query
It calls InfoPanel.onQueryCallback, followed by InfoPanel.updateContext. These are called with checkQueryCriteria = true, which causes the value of C_Order_ID from the parameter to be put in Env.getCtx (introduce by IDEMPIERE-5772)
In step 5, when the Order parameter is cleared, the code flow is as follows:
The value of C_Order_ID in the parameter is removed from InfoWindow.infoContext.
The display logic of the Invoice parameter is evaluated using InfoWindow.infoContext as the context. However, if it falls back to Env.getCtx, it retrieves @C_Order_ID@ as 10000, causing the Invoice field to remain invisible
It performs a query
It calls InfoPanel.onQueryCallback, followed by InfoPanel.updateContext, with checkQueryCriteria = true. This removes C_Order_ID from Env.getCtx.
workaround for variable relate to info window, use 1113 (info window context)
why does IDEMPIERE-5772 require setting the parameter to a window context variable?
Environment
None
Attachments
4
Activity
Show:
Peter Takacs4 days ago
why does IDEMPIERE-5772 require setting the parameter to a window context variable?
Hi
in we wanted to make parameters as well as values from the actual rows accessible in the quick info (see the comments in the ticket) to be able to create various widgets from relevant data.
Hiep Lqlast week
Setting environment variables from another scope (such as an Info Window or Process) into the window scope is risky, as it can potentially introduce new values or override existing ones.
Create a Purchase Order, then complete it (example Purchase Order ID = 10000).
Create a Material Receipt header
Click “create lines from“ to open the “Create lines from Shipment/Receipt“ info window
In the Order parameter, select the Purchase Order created in step 1 => the Invoice field becomes invisible, and a row is selected.
Clear the Order field => the result shows no records, but the Invoice field is still invisible
Reason:
The invoice display logic depends on the order (… &@C_Order_ID@=0) and uses
InfoWindow.infoContext
as the context for evaluation. IfinfoContext
is not provided, it falls back toEnv.getCtx
by defaultIn step 4, when selecting a purchase order, the flow proceeds as follows:
The parameter value of
C_Order_ID
is stored inInfoWindow.infoContext
by callvalueChange
The display logic of the Invoice parameter is evaluated using
InfoWindow.infoContext
as the context let it invisibleIt performs a query
It calls
InfoPanel.onQueryCallback
, followed byInfoPanel.updateContext
. These are called withcheckQueryCriteria = true
, which causes the value ofC_Order_ID
from the parameter to be put inEnv.getCtx
(introduce by IDEMPIERE-5772)In step 5, when the Order parameter is cleared, the code flow is as follows:
The value of
C_Order_ID
in the parameter is removed fromInfoWindow.infoContext
.The display logic of the Invoice parameter is evaluated using
InfoWindow.infoContext
as the context. However, if it falls back toEnv.getCtx
, it retrieves@C_Order_ID@
as 10000, causing the Invoice field to remain invisibleIt performs a query
It calls
InfoPanel.onQueryCallback
, followed byInfoPanel.updateContext
, withcheckQueryCriteria = true
. This removesC_Order_ID
fromEnv.getCtx
.workaround
for variable relate to info window, use 1113 (info window context)
why does IDEMPIERE-5772 require setting the parameter to a window context variable?