You need to sign in to do that
Don't have an account?
F Smoak
DML requires SObject or SObject list type: Set<String>
I have written a beow code where I have a text field on my object which populates duplicate values of territory name. I need to retrieve a set of this field value (in form of string as the field data type is text) but getting following error.- DML requires SObject or SObject list type: Set<String> in below bold line
Please help!
code:
trigger CMS_Insert_MCCP on CMS_Rule_Line_Item__c (after Insert) {
List<Territory> territoryList = new List<Territory>();
List<MC_Cycle_Plan_vod__c> mccp = new List<MC_Cycle_Plan_vod__c>();
Set<String> teamList = new Set<String>();
for(CMS_Rule_Line_Item__c crRecord: Trigger.new){
teamList.add(crRecord.CMS_Team__c);
}
insert teamList;
}
Please help!
code:
trigger CMS_Insert_MCCP on CMS_Rule_Line_Item__c (after Insert) {
List<Territory> territoryList = new List<Territory>();
List<MC_Cycle_Plan_vod__c> mccp = new List<MC_Cycle_Plan_vod__c>();
Set<String> teamList = new Set<String>();
for(CMS_Rule_Line_Item__c crRecord: Trigger.new){
teamList.add(crRecord.CMS_Team__c);
}
insert teamList;
}
Let me know if this helps
Thanks,
Anudeep
as: Method does not exist or incorrect signature: void add(String) from the type List<CMS_Rule_Line_Item__c>
Let me know if that still gives you an error