Cannot create report with virtual column where reference is table with display column = ID
Description
Test case:
Log in as System Administrator
Open Table and Column and search for the table Test
Add a new virtual column with the following data:
System Element → SalesRep_ID
Column SQL → (100)
leave the rest with the defaults, note the key here is that the Reference Key is assigned to “AD_User - SalesRep” - which is a reference table with Display Column defined as “AD_User_ID”
Open Test window
Click on Report button and select the Print Format “Test Report”
Click Customize Report and in Format Item tab add a new item with the following data:
Name → Sales Representative
Print Text → Sales Representative
Column → SalesRep_ID
leave the rest with the defaults
Go back to the report generated and click the Refresh button
Result → ERROR: org.postgresql.util.PSQLException: ERROR: column test.salesrep_id does not exist Position: 1379[SQL: 0, 42703]
The issue is solved if the display column is changed back to Name, but this is a workaround, it must work correctly with the ID which was set with ticket IDEMPIERE-4448
Test case:
Log in as System Administrator
Open Table and Column and search for the table Test
Add a new virtual column with the following data:
System Element → SalesRep_ID
Column SQL → (100)
leave the rest with the defaults, note the key here is that the Reference Key is assigned to “AD_User - SalesRep” - which is a reference table with Display Column defined as “AD_User_ID”
Open Test window
Click on Report button and select the Print Format “Test Report”
Click Customize Report and in Format Item tab add a new item with the following data:
Name → Sales Representative
Print Text → Sales Representative
Column → SalesRep_ID
leave the rest with the defaults
Go back to the report generated and click the Refresh button
Result → ERROR: org.postgresql.util.PSQLException: ERROR: column test.salesrep_id does not exist
Position: 1379[SQL: 0, 42703]
The issue is solved if the display column is changed back to Name, but this is a workaround, it must work correctly with the ID which was set with ticket IDEMPIERE-4448