Skip to content

Commit

Permalink
Fix aroung QueryMore and EntityDefinition #362
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceFINET committed Mar 18, 2024
1 parent 9e5cd37 commit 54d2705
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class OrgCheckSalesforceManager {
}
} else {
records.push(... d.records);
if (d.done === true) {
if (d.done === true || (d.done === false && q.queryMore === false)) {
resolve({ records: records });
} else {
conn.queryMore(d.nextRecordsUrl, recursive_query);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class OrgCheckDatasetObject extends OrgCheckDataset {
const promises = [];
promises.push(sfdcManager.describe(fullObjectApiName));
promises.push(sfdcManager.soqlQuery([{
tooling: true,
queryMore: false, // we should have only one record max so no need to have queryMore activated.
tooling: true, // We need the tooling to get the Description, ApexTriggers, FieldSets, ... which are not accessible from REST API)
string: 'SELECT Id, DurableId, DeveloperName, Description, NamespacePrefix, ExternalSharingModel, InternalSharingModel, '+
'(SELECT Id, DurableId, QualifiedApiName, Description, IsIndexed FROM Fields), '+
'(SELECT Id, Name FROM ApexTriggers), '+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ export class OrgCheckDatasetObjects extends OrgCheckDataset {
const promises = [];

// Requesting information from the current salesforce org
promises.push(sfdcManager.describeGlobal());
promises.push(sfdcManager.describeGlobal()); // not using tooling api !!!

// Some information are not in the global describe, we need to append them with EntityDefinition soql query
promises.push(sfdcManager.soqlQuery([{
tooling: true,
queryMore: false, // entityDef does not support calling QueryMore
tooling: false, // so not using tooling either!!!
string: 'SELECT DurableId, NamespacePrefix, DeveloperName, QualifiedApiName, '+
'ExternalSharingModel, InternalSharingModel '+
'FROM EntityDefinition ' +
Expand Down

0 comments on commit 54d2705

Please sign in to comment.