Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Set all contacts with non-Household accounts to Household accounts
Contact[] contacts = [select Id, AccountId from Contact where Account.RecordType.DeveloperName != 'HH_Account'];
for (Contact contact : contacts)
contact.AccountId = null;
update contacts;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.