I have made this query for widget. It is working properly if i pass the value directly(ie. ad_role_id). But it is not running when i use dynamic parameter(:role).
for this i have done entry in parameters too. Please give me some suggestion on it.
hql query:
SELECT ORG.name AS orgName
,INV.documentNo AS documentNo
,INV.invoiceDate AS invoiceDate
,BP.name AS name
,DT.name AS Doctype
,INV.grandTotalAmount AS grandTotalAmount
FROM Invoice INV,
DocumentType AS DT,
BusinessPartner AS BP,
Organization AS ORG
WHERE ORG.id = INV.organization
AND BP.id = INV.businessPartner
AND INV.transactionDocument = DT.id
AND INV.salesTransaction = 'N'
AND INV.id not in (select distinct e.invoice from InvoiceLine e )
AND INV.organization.id IN (select o.id
from Organization AS o,ADRoleOrganization AS arg,ADRole AS ar
where arg.organization = o.id
and ar.id = arg.role
and arg.role = :role)
Probably your parameter configuration for role was not correct.
use Default_Filter_Expressions and configure role as fixed value in parameter.
http://wiki.openbravo.com/wiki/Projects:Selector/Default_Filter_Expressions