jsforce metadata.deploy,部署ID

时间:2019-03-21 15:12:54

标签: salesforce jsforce

我希望在回调中返回创建的部署ID,创建后如何立即获得它? 这来自jsforce文档。在此仅在完成时调用它。

var fs = require('fs');
var zipStream = fs.createReadStream("./path/to/MyPackage.zip");
conn.metadata.deploy(zipStream, { runTests: [ 'MyApexTriggerTest' ] })
  .complete(function(err, result) {
    if (err) { console.error(err); }
    console.log('done ? :' + result.done);
    console.log('success ? : ' + result.true);
    console.log('state : ' + result.state);
    console.log('component errors: ' + result.numberComponentErrors);
    console.log('components deployed: ' + result.numberComponentsDeployed);
    console.log('tests completed: ' + result.numberTestsCompleted);
  });

1 个答案:

答案 0 :(得分:0)

这简直太简单了,我能够弄清楚这一点,只使用不完整的回调即可。