我从查询中获取 1561 条记录,现在我想在其他函数中传递记录 ID,它根据我们传递给该函数的特定 ID 检索其他记录
我不明白我可以使用 map 或其他方法将 Id 传递给其他函数,因此不会影响 salesforce 限制
我还分享了我的一小段代码:
SendUpdateEmailList = [SELECT Id,
Update72Hrs_email__c,
File_Number__c,
Loan_Number__c,
Client_ID__c,
Borrower_Name__c,
Order_Status__c,
Current_Status_Notes__c,
Time_Since_Last_Updated__c
FROM Etrac_Orders__c
WHERE Order_Status__c!='Completed'
AND Order_Status__c!='Cancelled'
AND Order_Status__c!='Delayed by Borrower'
AND Order_Status__c!='On Hold'
AND Time_Since_Last_Updated__c > 72
AND IsDeleted <> true ];
system.debug('SendUpdateEmailList>>>>>>>>>>'+SendUpdateEmailList);
// map<id,string> myAMap = new map<id,string>();
for ( Etrac_Orders__c c:SendUpdateEmailList ){
myAMap.put(c.Id,c.File_Number__c);
}
for (ID aID : myAMap.keySet()){
myAMap.get(aID);
system.debug('<<<<<<<<<<aID'+aID);
workFlowChecker(aID); //this statement creates the limitation problem
}
public void WorkFlowChecker(ID id) {
system.debug('WorkFlowChecker-id>>>>>>>' + id);
datetime systemtime = System.now();
system.debug('systemtime>>>>>>>>>>>' + systemtime);
//date mydate = Date.ValueOf();
//datetime systemdate = dDate.format('MM/dd/yyyy hh: mm: ss a');
try {
workFlow = [SELECT Id,
Executed__c,
OrdersID__c,
Executed_Date__c,
WorkflowName__c From Workflow__c Where WorkflowName__c = 'Update72Hrs_email' AND OrdersID__c = : id Order by Executed_Date__c DESC Limit 1];
system.debug('workFlow>>>>>>>' + workFlow);
// system.debug('Executed_Date__c>>>>>>>>'+workFlow.Executed_Date__c);
for (Workflow__c record : workFlow) {
string WorkFlowId = record.Id;
Boolean Executed = record.Executed__c;
string OrdersID = record.OrdersID__c;
datetime Executed_Date = record.Executed_Date__c;
}
return;
} catch (QueryException e) {
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'No Record Found'));
return ;
}
}