I'm getting the following error 'System.ListException: Before Insert or Upsert list must not have two identically equal elements' when i'm trying below code
Map<Id,SBQQ__QuoteLine__c> parentQuoteLines = new Map<Id,SBQQ__QuoteLine__c>();
for(SBQQ__QuoteLine__c qli : qliToInsert){
if( String.isBlank(qli.SBQQ__RequiredBy__r.Id)
&& !parentQuoteLines .containsKey(qli.Id)
&&qliprodCodetoRecordMap.containsKey(qli.SBQQ__Product__c)){
parentQuoteLines.put(qli.Id,qliprodCodetoRecordMap.get(qli.SBQQ__Product__c));
}
if(!parentQuoteLines .values().isEmpty()){
insert parentQuoteLines .values(); // Getting error when inserting
}
qliprodCodetoRecordMap
stores? There is a possibility that same record has been added in map.