Skip to content

Commit

Permalink
feat: Added support to use order by in SOQL queries for the core:Expo…
Browse files Browse the repository at this point in the history
…rtFiles Add On #779
  • Loading branch information
hknokh committed Aug 13, 2024
1 parent b0945c2 commit 2d7f74f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/modules/components/common_components/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1216,19 +1216,17 @@ export class Common {
};
let whereValuesCounter: number = 0;
let whereValues = new Array<string>();

let parsedWhere: Query;
if (whereClause) {
parsedWhere = whereClause && parseQuery('SELECT Id FROM Account WHERE (' + whereClause + ')');
//parsedWhere.where.left.openParen = 1;
//parsedWhere.where.left.closeParen = 1;
parsedWhere = parseQuery('SELECT Id FROM Account WHERE (' + whereClause + ')');
}

let parsedOrderBy: Query;
if(orderByClause){
parsedOrderBy = orderByClause && parseQuery('SELECT Id FROM Account ORDER BY ' + orderByClause + '')
if (orderByClause) {
parsedOrderBy = parseQuery('SELECT Id FROM Account ORDER BY ' + orderByClause + '')
}


function* queryGen() {
while (true) {
for (let whereClausLength = whereClauseLength; whereClausLength < CONSTANTS.MAX_SOQL_WHERE_CLAUSE_CHARACTER_LENGTH;) {
Expand All @@ -1255,7 +1253,7 @@ export class Common {
tempQuery.where.operator = "AND";
}

if(parsedOrderBy){
if (parsedOrderBy) {
tempQuery.orderBy = parsedOrderBy.orderBy
}

Expand Down

0 comments on commit 2d7f74f

Please sign in to comment.