Skip to content

Instantly share code, notes, and snippets.

@lfreeland
Created March 28, 2016 12:35
Show Gist options
  • Save lfreeland/9093ef1523efbfda9af8 to your computer and use it in GitHub Desktop.
Save lfreeland/9093ef1523efbfda9af8 to your computer and use it in GitHub Desktop.
Valid Dynamic SOQL Function and SObject Reference Examples
// Valid Dynamic SOQL from function
Set<Id> accountIds = getAccountids();
String accountQuery = ‘Select id, name from Account where Id in :accountIds’;
// Valid Dynamic SOQL from SObject
Account acct = new Account(Id = ‘Some_Acct_Id_Here’);
Id accountId = acct.Id;
String accountQuery = ‘Select id, name from Account where Id = :accountId’;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment