November Happy Hour will be moved to Thursday December 5th.

Query Topics by Users

Vote:
 
I have a problem when I want to make a query in forum.
I want to find all topics in a forum posted by users that have an attribute "group01".

As I see it I can make Queries where I can filter the Topics by Author but not by Users where I have some attributes. Do I have to connect Author and User in some way?
#27718
Feb 09, 2009 10:46
Vote:
 

Hi Pål,

I had a similar problem and solved it by using a UserAuthorCriterion to filter on the User attribute:

UserAuthorCriterion criterion = new UserAuthorCriterion();
criterion.User = new UserCriterion();
criterion.User["Attribute"] = new IntegerCriterion();
((IntegerCriterion)criterion.User["Attribute"]).Value = attributeValue;

TopicQuery topicQuery = new TopicQuery();
topicQuery.Author = criterion;

Maybe there are other ways of doing it but this seems to work fine for me.

Best regards,
Helena

#27743
Feb 09, 2009 11:40
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.