The select i did is a litle bit tricky, since my organization pkg is set up as non-singleton, so i need to pass the package_id and organization_id in the query to get each organization of each package the user owns.
the query:
?xml version="1.0"?
queryset
fullquery name="orgs_query"
querytext
SELECT
o.organization_id,
o.name,
o.legal_name,
o.reg_number,
o.notes,
ot.type as organization_type
FROM
organizations o,
organization_types ot,
organization_type_map tm
WHERE
o.organization_id in (SELECT ow.organization_id
FROM organization_owner ow
WHERE user_id = :user_id)
AND
o.organization_id = tm.organization_id and
o.packages = :(SELECT ow.package_id
FROM organization_owner ow
WHERE user_id =: user_id)
tm.organization_type_id = ot.organization_type_id and
[template::list::filter_where_clauses -and -name "orgs"]
[template::list::orderby_clause -orderby -name orgs]
/querytext
/fullquery
The attribution is incorrectly made
o.packages = :(SELECT ow.package_id
FROM organization_owner ow
WHERE user_id =: user_id)
MAlte,
I haven't found anything similar to this on the link you post above. Although it's a very good source, thanks a lot.