@SQL usage issue in InfoWindow

99 views
Skip to first unread message

Ken Longnan

unread,
May 2, 2022, 6:54:58 AM5/2/22
to iDempiere
Hi Community,

I have an issue to use @SQL in InfoWindow for Display Logic. Tested in https://test.idempiere.org

In Window 'Business Partner'->Tab 'Business Partner', I can setup Display logic (@SQL=select 1 from DUAL where 1=2) for Name 2, and it is working fine.
 
2022-05-02_184921.png

But when try to setup similar things in Product Info, it is not working as expected, encounter errors like below:

2022-05-02_185142.png

line 1:0 token recognition error at: '@SQL=select 1 from DUAL where 1=2'
05:37:29.926===========> LogicEvaluator.evaluateLogic: Logic=@SQL=select 1 from DUAL where 1=2 Error=line 1:33 mismatched input '<EOF>' expecting {'$!', 'true', 'false', '(', DECIMAL, VARIABLE, QTEXT, DQTEXT, TEXT} [340]
org.antlr.v4.runtime.misc.ParseCancellationException: line 1:33 mismatched input '<EOF>' expecting {'$!', 'true', 'false', '(', DECIMAL, VARIABLE, QTEXT, DQTEXT, TEXT}
    at org.idempiere.expression.logic.ThrowingErrorListener.syntaxError(ThrowingErrorListener.java:44)
    at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
    at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
    at org.antlr.v4.runtime.DefaultErrorStrategy.reportInputMismatch(DefaultErrorStrategy.java:327)
    at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:139)
    at org.idempiere.expression.logic.SimpleBooleanParser.expression(SimpleBooleanParser.java:422)
    at org.idempiere.expression.logic.SimpleBooleanParser.parse(SimpleBooleanParser.java:123)
    at org.idempiere.expression.logic.LogicEvaluator.evaluateLogic(LogicEvaluator.java:74)
    at org.compiere.util.Evaluator.evaluateLogic(Evaluator.java:92)
    at org.compiere.model.InfoColumnVO.isDisplayed(InfoColumnVO.java:273)
    at org.adempiere.webui.info.InfoWindow.prepareTable(InfoWindow.java:847)
    at org.adempiere.webui.info.InfoWindow.executeQuery(InfoWindow.java:1761)
    at org.adempiere.webui.info.InfoProductWindow.executeQuery(InfoProductWindow.java:939)
    at org.adempiere.webui.panel.InfoPanel.onQueryCallback(InfoPanel.java:2525)
    at org.adempiere.webui.info.InfoWindow.onQueryCallback(InfoWindow.java:2514)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3169)
    at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3098)

Are there something wrong from my setup of @SQL in InfoWindow? Any help or hints are welcome!

Thanks a lot!

BR,

Ken

Diego Ruiz

unread,
May 2, 2022, 11:07:54 AM5/2/22
to iDempiere
Hi Ken,

As far as I know and can see in the code, SQL Display Logic is not implemented for Info Window Columns.

BTW - I don't know if the logic you posted was just meant as an example, but if you want to hide a column or field, you can simply set it to 1=2, no need to do the @SQL=...

Best regards,
Diego

Ken Longnan

unread,
May 7, 2022, 11:14:05 AM5/7/22
to iDempiere
Hi Diego,

Thanks for the explanation! I just want to test @SQL for Display Logic in InfoWindow, but unfortunately it has not been implemented yet so far.

BR,

Ken
Reply all
Reply to author
Forward
0 new messages