You need to sign in to do that
Don't have an account?

Update contact account
Am I losing my mind? The snippet below isn't updating my contacts, I don't get any errors or anything it just dosn't update the records. The number of DML rows: 197 out of 10000 is reported and expected. There are no triggers in the org that would get in the way.
Account a = [select id, name from account where name='New Name']; List<Contact> cList = [Select id, name, account.name from contact where account.name = 'Old Name']; for(contact i : cList) { i.account = a; } update cList;
Yes I am losing my mind... Time to take a break.
All Answers
Yes I am losing my mind... Time to take a break.
Mark this as Accepted, as it will be helpful to forum users in implementing the code.
Sirs, I have a question,
could I use List and Set Collections at the same time?
I'm creating a trigger for Account (before insert, before update) that'll have to avoid the duplication of Account names. like,