You need to sign in to do that
Don't have an account?
Team Works
How to concatenate strings to form a Query
Hello Guys
Again Stuck with the concatenation :
private final String SOQL_RECENT_REC = 'SELECT LastViewedDate,Type,UserRoleId FROM RecentlyViewed';
private final String CONDITION_USER_SORT = ' Order By LastViewedDate DESC LIMIT 20';
List<RecentlyViewed> recentViewed= new List<RecentlyViewed>();
recentViewed = Database.query(SOQL_RECENT_REC +' WHERE Type = \'Account \' ' + CONDITION_USER_SORT);
Should run a query like the following :
recentViewed = [SELECT LastViewedDate,Type,UserRoleId FROM RecentlyViewed Where Type='Account' Order By LastViewedDate DESC LIMIT 20];
Many Thanks !!
Again Stuck with the concatenation :
private final String SOQL_RECENT_REC = 'SELECT LastViewedDate,Type,UserRoleId FROM RecentlyViewed';
private final String CONDITION_USER_SORT = ' Order By LastViewedDate DESC LIMIT 20';
List<RecentlyViewed> recentViewed= new List<RecentlyViewed>();
recentViewed = Database.query(SOQL_RECENT_REC +' WHERE Type = \'Account \' ' + CONDITION_USER_SORT);
Should run a query like the following :
recentViewed = [SELECT LastViewedDate,Type,UserRoleId FROM RecentlyViewed Where Type='Account' Order By LastViewedDate DESC LIMIT 20];
Many Thanks !!
\
recentViewed = Database.query(SOQL_RECENT_REC +' WHERE Type = \'Account\' OR Type = \'Contact\' ' + CONDITION_USER_SORT);
All Answers
thanks,
Ramesh
\
recentViewed = Database.query(SOQL_RECENT_REC +' WHERE Type = \'Account\' OR Type = \'Contact\' ' + CONDITION_USER_SORT);