Retrieving Data
SObject.retrieve(qry, opts?)
SObject.retrieve(qry, opts?)import { Account } from './generated';
const accounts = await Account.retrieve(
'SELECT Id, Name FROM Account LIMIT 1'
);
//using query builder (recommended)
const accounts = await Account.retrieve(f => ({
select: f.select('id','name'),
limit: 1
}));
// explicitly setting the Rest client
const accounts = await Account.retrieve(
'SELECT Id, Name FROM Account LIMIT 1',
{ restInstance: someOtherOrg }
);Opts
Last updated
Was this helpful?