+ Start a Discussion

Error while using StandardSetController

Hello there,


Following code is giving me unknown error:


String strFetchMatchesQuery = 'Select m.Project__r.Project_Title__c,m.Project__r.Template__r.Max_Estimated_Hours_for_Volunteer__c,m.Project__r.Projected_Hours__c, m.Volunteer__r.AccountId, m.Project__r.Organization__r.Name, m.Project__r.Volunteer__r.Name, m.Volunteer__r.Name, m.Project__r.Status__c,m.Project__r.Actual_Hours__c,m.Project__r.ProjectNickname__c,m.Project__r.Volunteer_Projected_Hours__c, m.Project__r.Name From Match__c m where m.Volunteer__c IN ('+ strVolunteerId + ') AND ( m.Project__r.Status__c = \'Active\' OR m.Project__r.Status__c = \'Closed\' OR m.Project__r.Status__c = \'Incomeplete\')';


lstMatch = Database.Query(strFetchMatchesQuery);


ApexPages.StandardSetController matchActivityStandardSet = new ApexPages.StandardSetController(lstMatch);


Well, I am tracking the the corresponding Customer User Portal in developer console. Loading the page causes above code to fire. And code execution status is coming as "Success". But, I am not able to track the problem.


Please help.


Thanks in advance.

Shiv ShankarShiv Shankar

Are you using try catch block ?

No, I am not using try catch block. Shall I?
Thank u..that solved problem.
However, I am using try-catch block for same functionality but for list of some other objects, its giving error again.

Please help.