Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mattparlane
Created July 14, 2017 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattparlane/1f443da72e64236b941799b194833194 to your computer and use it in GitHub Desktop.
Save mattparlane/1f443da72e64236b941799b194833194 to your computer and use it in GitHub Desktop.
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