Created
April 9, 2018 14:31
-
-
Save wadewegner/6860013640924603abb062c421b79fed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const forceUtils = require('../lib/forceUtils.js'); | |
const request = require('request'); | |
(function () { | |
'use strict'; | |
module.exports = { | |
topic: 'test', | |
command: 'cmd', | |
description: 'test', | |
help: 'help text for text:cmd', | |
flags: [], | |
run(context) { | |
let targetUsername = ''; | |
forceUtils.getOrg(targetUsername, (org) => { | |
targetUsername = org.authConfig.username; | |
org.force._getConnection(org, org.config).then((conn) => { | |
// console.log(conn); | |
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); | |
}); | |
}); | |
}); | |
} | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment