You need to sign in to do that
Don't have an account?
D'Mario Lewis
Can I redirect to another page with the variables included
public PageReference report(){ PageReference np = null; starts = startDate.format(); //formats date as MM/DD/YYYY ends = endDate.format(); String value = getClassisObject().get(0).getValue(); if(reportObj.equals('church')){ String[] splitter = churchObj.split(':'); churchReport(year, splitter[0].trim(), startDate, endDate); np = new PageReference('/apex/crcna_MinistryShare_ChurchReport'); } if(reportObj.equals('full')){ List<Account> lstClassis = ClassisList(classisObj, value, reportObj); List<Account> lstChurches = ChurchList(lstClassis); if(classisObj <> value){ lstSubtotals = fullDetail(countryObj, lstChurches, year, startDate, endDate); np = new PageReference('/apex/crcna_MinistryShare_ClassisReport'); } } np.setRedirect(true); return np; }
Please see below to set variables. Please mark this answer as solution if this resolves your question.
Instead of making np.getParameters.put() method each time to add variable as parameter, we can use a map of type <String,String> which will contain all the mappings related to the variables which need to be passed by URL.
At last we can use np.getParameters().putAll(map) to add all the parameters in one go.
Thanks,
Pankaj