Skip to content

Instantly share code, notes, and snippets.

@Tim-Machine
Last active April 9, 2018 16:08
Show Gist options
  • Select an option

  • Save Tim-Machine/63ec628df6d5f1ec40a2e9645139ec1c to your computer and use it in GitHub Desktop.

Select an option

Save Tim-Machine/63ec628df6d5f1ec40a2e9645139ec1c to your computer and use it in GitHub Desktop.
const conn = this.org.getConnection();
// Attempt 1
conn.sobject("Account").describe(function(err, meta) {
if (err) { return console.error(err); }
console.log('Label : ' + meta.label);
console.log('Num of Fields : ' + meta.fields.length);
});
// Attempt 2
conn.describe("Account", function(err, meta) {
if (err) { return console.error(err); }
console.log('Label : ' + meta.label);
console.log('Num of Fields : ' + meta.fields.length);
});
// Attempt3 (inspired by existing query example)
const profileData = await conn.describe("Account");
// All give the following error
// this.request(...).thenCall is not a function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment