javajakarta-eeadempiere

Adempiere Hiding / Showing Field Based on tick mark checked or unchecked in client widnow by using display logic


I am working with adempiere, I would like to Hide/Show field of a window based on tick mark available in another window Client which is (AD_Clinet table). E.g. I created barcode field in Material Receipt window which i would like to show only when Client screen Scan Barcode On Material Receipt is tick marked. I am using Display logic of window Tab Field > Tab > Field ,following things are tried by me

  1. AD_Client.Is_ScanBarcodeMaterialReceiot
  2. Barcode_Field= @SELECT Is_ScanBarcodeMaterialReceiot FROM AD_Client WHERE AD_Client_ID=@#AD_Client_ID@@
  3. @Barcode_Field=AD_Client.Is_ScanBarcodeMaterialReceiot@

I didn't got proper output for that.

Please provide suggessions to solve out this problem.


Solution

  • The display logic in ADempiere does not support sql statements. You can use the SQL in a virtual column and then reference that column in your display logic.

    So add a Yes/No virtual column to the table with the sql value set to

    SELECT AD_Client.Is_ScanBarcodeMaterialReceipt FROM AD_Client WHERE AD_Client_ID=@#AD_Client_ID@
    

    Call this column by the same name Is_ScanBarcodeMaterialReceipt. Add it to the window/tab but don't display it. The value should appear in the context when you open the window.

    Then you can set your display logic on the bar code field to

    @Is_ScanBarcodeMaterialReceipt@=Y