You need to sign in to do that
Don't have an account?
Somasundaram Subramanian
batch job value of list
am new to development , in below code they are getting values in Projects and using this projects value in soql query
am new to development, what will be the value of projects in below code
global void execute(Database.BatchableContext BC, List<pse__Proj__c> projects){
date M_TDate = date.today();//Today Date
date M_SWDate = M_TDate.toStartofWeek();//Start Date of week
date M_EWDate = M_SWDate.addDays(6);//End Date of Week
set <string> ResourceRequestStatus= new set <string> {'Ready to Staff'};
set <string> TimePeriodType = new set <string> {'Week'};
map<Id,set<Id>> mapAssignmentEVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapRREVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapMilestoneRREVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapMilestoneEVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapBudgetRREVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapBudgetEVA = new map<Id,set<Id>>();
map<Id,pse__Resource_Request__c> mapRRforRR = new map<Id,pse__Resource_Request__c>([select Id, pse__Project__c,pse__SOW_Hours__c, pse__Requested_Bill_Rate__c, pse__Assignment__c, pse__Milestone__c
from pse__Resource_Request__c where pse__Status__c IN: ResourceRequestStatus and pse__Project__c IN: projects]);
am new to development, what will be the value of projects in below code
global void execute(Database.BatchableContext BC, List<pse__Proj__c> projects){
date M_TDate = date.today();//Today Date
date M_SWDate = M_TDate.toStartofWeek();//Start Date of week
date M_EWDate = M_SWDate.addDays(6);//End Date of Week
set <string> ResourceRequestStatus= new set <string> {'Ready to Staff'};
set <string> TimePeriodType = new set <string> {'Week'};
map<Id,set<Id>> mapAssignmentEVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapRREVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapMilestoneRREVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapMilestoneEVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapBudgetRREVA = new map<Id,set<Id>>();
map<Id,set<Id>> mapBudgetEVA = new map<Id,set<Id>>();
map<Id,pse__Resource_Request__c> mapRRforRR = new map<Id,pse__Resource_Request__c>([select Id, pse__Project__c,pse__SOW_Hours__c, pse__Requested_Bill_Rate__c, pse__Assignment__c, pse__Milestone__c
from pse__Resource_Request__c where pse__Status__c IN: ResourceRequestStatus and pse__Project__c IN: projects]);
Can you explain a little bit more, that will be very helpful to me to understand your queries.
Thanks
I got 50001 governor limit in the below line , so i would like to know how they are getting this "Projects" i want to reduce the collection in this soql ,
map<Id,pse__Resource_Request__c> mapRR = new map<Id,pse__Resource_Request__c>([select Id, pse__Project__c,pse__SOW_Hours__c, pse__Requested_Bill_Rate__c
from pse__Resource_Request__c where pse__Status__c IN: ResourceRequestStatus and pse__SOW_Hours__c > 0
and pse__Project__c IN: projects]);
- The total number of records retrieved by SOQL queries for synchronous Apex and asynchronous Apex is 50000. This is the per-transaction limit, and not a per-query limit.
- SOQL calls should be filtered. They should have a WHERE clause and LIMIT which could prevent this exception.
- One most important thing that everyone misses out on is Aggregate queries thinking, it is returning only the aggregate rows but queries with aggregate functions count each row used by the aggregation(as a query row) for limit tracking.
- Use these following debug statements to check query rows governor limit of your org and the rows queried so far in your code.
- System.debug(‘Total number of records retrieved by SOQL queries:’+Limits.getLimitDmlRows());
- System.debug(‘Number of records retrieved by SOQL queries so far: ‘ + Limits.getDmlRows());
Please mark it as Best Answer if the above information was helpful.Thanks.
Can you paste the start method code?