Hey thanks for your help, but i have problem . Values inserted first time correctly though In second time I geeting err. my code is List<Dupe_Customer_Detail__c> dupList= [Select Id, name, Last_Name__c from Dupe_Customer_Detail__c ];
for(integer i=0;i<3;i++){
Dupe_Customer_Detail__c dup = new Dupe_Customer_Detail__c(); dup.Name = 'Harshi'; dup.Last_Name__c ='A';
dupList.add(dup); } insert dupList; and err is Line: 13, Column: 1 System.DmlException: Insert failed. First exception on row 0 with id a0A5g000000Ig9kEAC; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id] what i need to do please tell me
Hi Swathi,
please find the solution
run this code in the anonymous window for inserting account
If you find this solution is helpful for you please mark the best answerIn case if you want to query all the triggers you can use the below soql query:
SELECT Id, Name, TableEnumOrId,UsageIsBulk FROM ApexTrigger where UsageIsBulk = true
The UsageIsBulk will Specify whether the trigger is defined as a bulk trigger (true) or not (false).
You can use query editor or in case if you are using anonymous window you can use the below lines:
list<ApexTrigger> apt= [SELECT Id, Name, TableEnumOrId,UsageIsBulk FROM ApexTrigger where UsageIsBulk = true];
system.debug(apt);
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
List<Dupe_Customer_Detail__c> dupList= [Select Id, name, Last_Name__c
from Dupe_Customer_Detail__c ];
for(integer i=0;i<3;i++){
Dupe_Customer_Detail__c dup = new Dupe_Customer_Detail__c();
dup.Name = 'Harshi';
dup.Last_Name__c ='A';
dupList.add(dup);
}
insert dupList;
and err is
Line: 13, Column: 1
System.DmlException: Insert failed. First exception on row 0 with id a0A5g000000Ig9kEAC; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
what i need to do please tell me