Menu

Set data in a window field (virtual columns?)

Developers
johny003
2011-03-23
2013-03-08
  • johny003

    johny003 - 2011-03-23

    Hi,
    I have a field in a window (Invoice).. and I want to set some data in this field.. It is virtual column, so the data are not in the table asociated with this window.. In ADempiere, there is a field "SQL Column" for virtual columns, if I understand right. But how can I refer to "actual invoice id" in the SQL query? I want something like this in the field:

    SELECT Order_ID FROM CUST_IOMatch WHERE C_Invoice_ID = <ID of actual Invoice>

    Can I solve this by this SQL Column? ..Thanks.

     
  • Trifon (An ADempiere founder)

    Hi,

    SELECT Order_ID FROM CUST_IOMatch WHERE C_Invoice_ID = <ID of actual Invoice>

    You can use @C_Invoice_ID@

    your query should look like below:

    SELECT Order_ID FROM CUST_IOMatch WHERE C_Invoice_ID = @C_Invoice_ID@
    

    Enjoy!

    Best regards,
    Trifon

     
  • Yan

    Yan - 2011-03-23

    Yes, you can write something like :

    (SELECT io.C_Order_ID FROM C_CUST_IOMatch io WHERE io.C_Invoice_ID = C_Invoice.C_Invoice_ID)

    Parenthesis are mandatory

    Regards,

    Yan

     
  • johny003

    johny003 - 2011-03-24

    thanks:) It helped :)

     

Log in to post a comment.