I have a report that lists all companies grouped by territory. I want to open that report restricted to companies in the territory in which the current user resides.
The user's territory is
PersonForm[Email_fld==zoho.loginuserid].Territory_fld
In the report definition I want to say
show all rows from CompanyForm[Territory_fld == this user's territory]
But if I code it thus
show all rows from CompanyForm[Territory_fld ==
PersonForm[Email_fld==zoho.loginuserid].Territory_fld]
the definition script saves OK but the report just comes up blank. This happens whether or not I enclose the user's territory definition in parentheses. Both territory fields contain the territory ID.
This is kinda key to my whole system, as I want users only to be able to see and manipulate data that pertains to them.
Anybody have any suggestions?