10-20-2010 02:40 AM
Excuse my freshness as far as HQL is concerned - I'm probably going about this the wrong way. Here's my 7.5.3 scenario:
I have a new entity x which has zero or more activities (so Activities is a child property of x).
I have created an Entity Page for x and I want to display associated Activities in a tab view.
All OK so far. My problem is that I want to display the username of the user to whom the Activities are assigned. I guess I could add Userinfo as a child property of Activity (mapped on UserId), but was hoping to do it via an HQL data source.
In my From clause I have the following:
Activity a, UserInfo u
and in my Where clause:
(a.AccountContactReportID = :crID) and (a.UserId = u.UserId)
where crID is the entityID of the 'current' entity, as specified under Parameters.
This builds and deploys OK, but when I access the page in a browser, I get a long error. The meat of it is as follows:
http://localhost:3333/SlxClient/ContactReport.aspx?entityid=QEVALA0000NR&gid=pEVALA0000C7 could not resolve property: UserId of: Sage.SalesLogix.Security.UserInfo [select a.Notes, a.StartDate, u.UserName from Sage.SalesLogix.Activity.Activity a, Sage.SalesLogix.Security.UserInfo u where (a.AccountContactReportID = :crID) and (a.UserId = u.UserId) order by a.StartDate ]
Obviously an issue with Userinfo.UserId, but what? Is it that there are two fields called UserId and HQL cannot differentiate? Or perhaps doing a join in this (let's face it, old fashioned) way is not supported in HQL?
Any input appreciated as always.
10-20-2010 11:14 PM
If you check the error message included with my first post, you'll see that that is exactly what I tried. At least I think that's what you mean
I had to get past this, so I ended up creating suitable properties between the entities and that worked fine, so no worries.
Thanks for responding.