You need to sign in to do that
Don't have an account?
bouscal
Need help understanding why I get an error when the code exactly matches other examples
Why do I get the error stating "Initial term of field expression must be a concrete SOBject: LIST<Case>?
public class HOL_NA_CaseEscalated { public static void processCase(Case[] cs) { Map<string,id> rType = new Map<string,id>(); for (RecordType rt : [SELECT id, developername FROM RecordType WHERE isactive=TRUE and sobjecttype='Case']){ rType.put(rt.DeveloperName, rt.Id); // add key/value pairs to map so we can lookup ID by name } // List all child cases on the triggering Case List<Case> CaseChildren = new List<Case>(); CaseChildren=[SELECT id,casenumber,parentid,subject FROM Case WHERE parentid=:cs.parentid]; // ERROR DIRECTS ME TO LINE ABOVE id rsc = rType.get('Record Type One'); id pdc = rType.get('Record Type Two'); for(Case c:cs){ if (c.recordtypeid==rsc){ // This is a Record Type One Case } else if (c.recordtypeid==pdc){ // This is a Record Type Two Case } else { // do nothing } } } }The error directs me to the last line above.
CS is a list, first you shd add case ids to a set and then query for that set of ids. Below is updated sample code.
Best Regards,
Mithun.
All Answers
CS is a list, first you shd add case ids to a set and then query for that set of ids. Below is updated sample code.
Best Regards,
Mithun.