You need to sign in to do that
Don't have an account?
d.tejdeep@nicomatic.in
I am getting this error here
new list<batch__c>(listBatchToadd)
How to get rid of this error ?
list must not have two identically equal elements
List<Batch__c> listBatchToadd=new List<Batch__c>(); For(integer j=0;j<2;j++){ batch__c b=new batch__c(); listBatchToadd.add(b); } For(integer i=0;i<count;i++){ qouteLineItemMap.put(i+1,new Quote_line_Item__c(Quote1__c=parentId)); // batchMap.put(i+1,new list<batch__c>(); batchMap.put(i+1,new list<batch__c>(listBatchToadd)); }System.ListException: Before Insert or Upsert list must not have two identically equal elements
I am getting this error here
new list<batch__c>(listBatchToadd)
How to get rid of this error ?
You are adding two identical records in the list. As I understand, all Batch records are empty so these are considered as Identical records.
Please let me know your excat reuirment only than I'll be able to help you.
Thanks,
Neetu
I am preapring layout for insert two parents attached with two childs each
Consider Quote_line_Item__c is parent ,Batch_c is child
Please see the figure then you will get this :
You must be adding same data in the batch, you cannot insert or upsert identical data in salesforce.
Try using different values in Batch and you will be able to do that.
Thanks,
Neetu
Batch__c b= new batch__c(master_id__c='teja'+j);
Even when i insert the values in the vf still i am facing the same error
Visualforce page :
Controller :