I am using a batch class where data iterated over an object
Now i am trying to retrieve some fields iterating over object1
Issue - its giving me common id for provider Base value
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityI am using a batch class where data iterated over an object
Now i am trying to retrieve some fields iterating over object1
Issue - its giving me common id for provider Base value
It appears that your formatting of code may have confused you. As written, you have a for loop within a for loop, so the values are getting written over and over again.
At minimum, this should help:
for(Object1__c obj : scope) {
lt.add(obj.Id);
system.debug('obj Id' +obj.Id);
}
for(object2 mmisPanel : [Some Soql query FROM Object1__c WHERE LTMS_Tracking_Number__c IN : track1 ] ){
Map1.put(mmp.RecordType.Name, mmte);
Map2.put(mmp.lt__r.PID_SL__r.PI_c,Map1);
}
{}
button or wrap in triple backticks (```) to format code blocks. – David Reed♦ Aug 11 '20 at 19:54