You need to sign in to do that
Don't have an account?
Help with custom setting Test class
HI,
Help needed in writing the test class for below class
public with sharing class ReportParam {
Public PageReference redirectReport()
{
Id testId = ApexPages.currentPage().getParameters().get('id');
String cn = ApexPages.currentPage().getParameters().get('cn');
ReportParamBuilder_Config__c r = ReportParamBuilder_Config__c.getValues(cn);
string qry = 'select '+r.QueryObjectField__c+' from '+r.QueryObjectName__c+' where '+r.QueryObjectPrimaryRefField__c+'=\''+testId+'\'';
List<SObject> resList = database.query(qry);
System.debug('----------ResultList:'+resList);
String stringUrl='';
if(r.QueryObjectName__c == 'Relationship_Group_Member__c'){
List<Relationship_Group_Member__c> rgmList = (List<Relationship_Group_Member__c>)resList;
for(Relationship_Group_Member__c obj : rgmList)
stringUrl = stringUrl +',' + obj.Group_Id__r.GCIF__c;
}
PageReference p = new PageReference('/'+r.ReportId__c+'?pv0='+stringUrl);
Return p;
}
}
Thanks