volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

AI OnAI Off

Query Topics by Users

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

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
error 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.