Pretius/apex-nested-reports

How to pass in multiple variables

Opened this issue · 3 comments

Hello,

Just wondering if it is possible to pass in multiple variables. I am trying by defining an extra with my attributes, I can pull up the value in my nested report query with the ## syntax as a column but when using the extra param in a where clause it bombs.

Any help is appreciated.

@neilfernandez
please reproduce where you have stuck at apex.oracle.com and send me developer login credentials to ostrowski.bartosz[at]gmail.com.

@bostrowski
I was able to find my issue.

When having the following type of query in my nested LOV source it has issues:

select *
from table1 t1
full outer join table2 t2 on t1.dl_id = t2.document_library_id and t1.item_id = t2.item_id
where (t1.document_library_id = #DOC_LIB_ID# and t1.company_id = #COMPANY_ID#)
       or  (t2.dl_id = #DOC_LIB_ID# and t2.company_id = #COMPANY_ID#)

But when I add a new line to separate the replacement strings, it works:

select *
from table1 t1
full outer join table2 t2 on t1.dl_id = t2.document_library_id and t1.item_id = t2.item_id
where (t1.document_library_id = #DOC_LIB_ID# 
             and t1.company_id = #COMPANY_ID#)
       or  (t2.dl_id = #DOC_LIB_ID# 
              and t2.company_id = #COMPANY_ID#)

I tested on the plugin function getColumnNamesFromQuery to see what it produced. The first query produced this:

"{
"queryColumns":[
"DOC_LIB_ID#\" and t1.company_id = #COMPANY_ID"
,"DOC_LIB_ID# and t2.company_id = #COMPANY_ID"
]
}
"

The second query produced this and worked:

"{
"queryColumns":[
"DOC_LIB_ID"
,"COMPANY_ID"
,"DOC_LIB_ID"
,"COMPANY_ID"
]
}
"

The issue seems to be in getColumnNamesFromQuery when using multiple params. Seems to require a new line. I can reproduce and post here later today! Thank you.

Hi @neilfernandez,

How do you set derived column attributes to hold multiple values?

Regards,
Mathias