I have below code which throws List index out of bound error.
I am not getting where i do wrong here.
Code
String Territory= '\''+ (String) p.get('Primary_Territory_vod__c')+'\'';
system.debug('Franchise@@@'+Franchise);
List<Territory> terr =[select Id, name , ParentTerritoryId from territory where name =:Territory];