Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created July 14, 2023 10:52
Show Gist options
  • Save arun12209/1d690ca9c07e6b71b33d10b2cbb3b913 to your computer and use it in GitHub Desktop.
Save arun12209/1d690ca9c07e6b71b33d10b2cbb3b913 to your computer and use it in GitHub Desktop.
Set<Id> accountIds = new Set<Id>();
for (Contact con : [SELECT Id, Name, AccountId FROM Contact WHERE Account.Name = 'Some Account']) {
accountIds.add(con.AccountId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment