Hi can any one help me out to resolve the issue when ever user clicks on a tab for example like Doctors after clicking that tab.
Too many SOQL queries: 101
The previous error is displayed. Below is the controller Constructor code. Can u guide me to resolve the issue?
// Constructor
public Msn_PromotionalStock_report_con(){
panel = false;
pbValue = false;
norecfin = false;
userFinalList = new set<Id>();
set<Id> setUser = new set<Id>();
setUser.add(Userinfo.getUserId());
allUsers = new set<Id>();
allUsers = getRoleSubordinateUsers(setUser);
allUsers.add(Userinfo.getUserid());
userobj = [Select id,Profile.Name,country,Region__c FROM User Where id =: userinfo.getuserId()];
prmSetForMR = new set<Id>();
if(userobj.Profile.Name == 'Medical Representative'){
SelectedMedicalrep = userinfo.getuserID();
}
else if(userobj.Profile.Name == 'Regional Manager'){
SelectedRegion = userobj.Region__c;
countrysSet = new set<String>();
for(Country__c cnt : [Select id,Name FROM Country__c Where Regional_Head__c =:userinfo.getuserId()]){
countrysSet.add(cnt.Name);
}
}
else if(userobj.Profile.Name == 'Country Manager'){
SelectedCountry = userobj.country;
}
else{}
usrLst = [Select id,Name FROM User Where id IN : allUsers And Profile.Name = 'Medical Representative' Order By Name Asc];
contentType = '';
renFilter = true;
htmlver = 'html-5.0';
isPagination = false;
prmSetForDownload = new set<Id>();
usr = [Select id,name,country,profile.name,region__c FROM USER Where id =: userinfo.getUserId()];
filecontent = '<h2>Promotional Stock Utilization</h2><table id="down" border="1"><tr><td><b>S.No</b></td><td><b>Input Name</b></td><td><b>Brand Name</b></td><td><b>Input Type</b></td><td><b>Total Qty</b></td><td><b>Allocated By</b></td><td><b>Allocated Date</b></td><td><b>Country</b></td><td><table id="down" border="1"><tr><td><b>Allocated to MR</b></td><td><b>Allocated to MR Date</b></td><td><b>Qty Allocated</b></td><td><b>Qty Utilized</b></td><td><table id="down" border="1"><tr><td><b>Presented to</b></td><td><b>Doctor/Pharmacy</b></td><td><b>Presented Date</b></td></tr></table></td></tr></table></td></tr>';
noRecordsFound = '';
}