2

how we can get list of (group.Name , group.LastFeedModifiedDate, user.Name , User.Username Form User & CollaborationGroup where group.OwnerId = user.Id And group.LastFeedModifiedDate < courantDate() - 30 mounth )

i have problem, whith SOQL we can use JOIN

thx

0

2 Answers 2

2

You can use Date Literals in SOQL Queries. Assuming you meant 3 months, i.e. 90 days

select id, Name, Owner.Name from CollaborationGroup where LastFeedModifiedDate < LAST_N_DAYS:90

If you wanted to filter on Owners too, add that to the where clause (ownerIds is a collection of UserIds you want to filter on)

select id, Name, Owner.Name from CollaborationGroup where LastFeedModifiedDate < LAST_N_DAYS:90 AND OwnerId IN :ownerIds

If you wanted to get the MemberIds, you can use :

select memberId from CollaborationGroupMember where CollaborationGroup.LastFeedModifiedDate < LAST_N_DAYS:90

OR

select Id, Name from User where Id IN (select memberId from CollaborationGroupMember where CollaborationGroup.LastFeedModifiedDate < LAST_N_DAYS:90)
4
  • hi @techtrekker,
    – KhaledZero
    Commented Jul 4, 2013 at 8:10
  • @KhaledZero I've added to my answer Commented Jul 4, 2013 at 12:51
  • i want a query like this Selecte User.name, User.Username, CollaborationGroup.Name, CollaborationGroup.lastFeedModifiedDate From User, CollaborationGroup Where CollaborationGroup.LastFeedModidiedDate < LAST_N_DAYS:90 bat whith SOQL we can not use the Join "Form User, CollaborationGroup" like in SQL So there is an auther solution? Thx.
    – KhaledZero
    Commented Jul 5, 2013 at 9:48
  • I want get : User.Id User.Userame Goup.Name Group.LastFeedModifiedDate thx
    – KhaledZero
    Commented Jul 5, 2013 at 9:53
0

groups whithout activity the last 3 mounth and the Username (Owner) SOQL

SELECT Owner.Username, LastFeedModifiedDate, Name, OwnerId 
FROM CollaborationGroup 
WHERE LastModifiedDate < LAST_N_DAYS:90
3
  • Please add some description text to your answer. Commented Jul 10, 2013 at 11:00
  • @mastOr .......done!
    – KhaledZero
    Commented Jul 10, 2013 at 11:31
  • That's pretty much the same as techtrekker's first SOQL, just filtering on a different date field.
    – Mike Chale
    Commented Jul 10, 2013 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .