Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build/src/api/core/orgcheck-api-salesforcemanager-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export class SalesforceManager extends SalesforceManagerIntf {
const allRecords = [];
const indexOfFromStatment = query.indexOf(' FROM ');
const indexOfGroupByStatment = query.indexOf(' GROUP BY ');
const isWhereStatmentAlreadyUsed = query.indexOf(' WHERE ') !== -1;
const isAggregateQuery = indexOfGroupByStatment !== -1;
// Alternative method to queryMore based on ID ordering (inspired by Maroun IMAD!)
const doNextQuery = async (/** @type {string} */ startingValue) => {
Expand All @@ -332,11 +333,11 @@ export class SalesforceManager extends SalesforceManagerIntf {
}
let realQuery;
if (isAggregateQuery === false) {
realQuery = `${query} AND ${field} > '${startingValue}' ORDER BY ${field} LIMIT ${MAX_NOQUERYMORE_BATCH_SIZE}`;
realQuery = `${query} ${isWhereStatmentAlreadyUsed ? 'AND' : 'WHERE'} ${field} > '${startingValue}' ORDER BY ${field} LIMIT ${MAX_NOQUERYMORE_BATCH_SIZE}`;
} else {
realQuery = `${query.substring(0, indexOfFromStatment)}, MAX(${field}) qmField `+ // Note that the max field is aliased to "qmField"
`${query.substring(indexOfFromStatment, indexOfGroupByStatment)} `+
(startingValue ? `WHERE ${field} > ${startingValue} ` : '')+
(startingValue ? `${isWhereStatmentAlreadyUsed ? 'AND' : 'WHERE'} ${field} > ${startingValue} ` : '')+
`${query.substring(indexOfGroupByStatment)} `+
`ORDER BY MAX(${field}) `+
`LIMIT ${MAX_NOQUERYMORE_BATCH_SIZE}`;
Expand Down
7 changes: 5 additions & 2 deletions sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"default": false,
"package": "Org Check",
"versionName": "Carbon",
"versionNumber": "6.1.7.NEXT",
"versionDescription": "Org Check is an easy-to-install and easy-to-use Salesforce application in order to quickly analyze your org and its technical debt."
"versionNumber": "6.0.0.NEXT",
"versionDescription": "Org Check is an easy-to-install and easy-to-use Salesforce application in order to quickly analyze your org and its technical debt.",
"ancestorVersion": "HIGHEST"
},
{
"path": "force-app",
Expand All @@ -23,6 +24,8 @@
"packageAliases": {
"Org Check (unlocked)": "0Ho2X000000KyjaSAC",
"Org Check (unlocked)@6.1.6-1": "04tKB000000DQDIYA4",
"Org Check (unlocked)@6.1.7-1": "04tKB000000DQMCYA4",
"Org Check (unlocked)@6.1.7-2": "04tKB000000DQMHYA4",
"Org Check": "0HoKB000000PAsc0AG",
"Org [email protected]": "04tKB000000DQHzYAO"
}
Expand Down