You need to sign in to do that
Don't have an account?
SHK
What is the Error in the following Log and How to Fix it?
http://pasted.co/53dbc34a
Please view the log and tell me how to fix it and why it occured !!
Please view the log and tell me how to fix it and why it occured !!
Since you are using multiple add statemnets on the accToInsert list in your code so there are some instances where the same account is being inserted in the list twice. I would recommend you to change the data type of the accToInsert variable to Set<Account>. When you try to insert this set, first convert it into list and then use insert statement.
I have also updated your code as per my sugegstion. Please find the updated code below:
Thanks,
Abhishek Bansal.
I also found that there is a duplicate quetion with the same error message at this link : https://developer.salesforce.com/forums/ForumsMain?id=9060G000000MQNyQAO
Can you please close this question as it may confuse others.
Thanks,
Abhishek Bansal.
The line where error occurs is :
update accToUpdate;
Please tell me how to solve this !!