Skip to content

Commit

Permalink
119 complex queries cause error on line 1905 column 1 systemqueryexce…
Browse files Browse the repository at this point in the history
…ption invalid bind expression type of date for column of type string (#121)

* SubQueries Binding Fix

Signed-off-by: Piotr PG Gajek <[email protected]>

* Code Improvement

Signed-off-by: Piotr PG Gajek <[email protected]>

---------

Signed-off-by: Piotr PG Gajek <[email protected]>
  • Loading branch information
pgajek2 authored May 8, 2024
1 parent 06f158b commit 98b45ce
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions force-app/main/default/classes/SOQL.cls
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ public virtual inherited sharing class SOQL implements Queryable {
}

public override String toString() {
return builder.resetBinding().toString();
binder = new Binder(); // clear binding before query build
return builder.toString();
}

public Object toValueOf(SObjectField fieldToExtract) {
Expand Down Expand Up @@ -877,11 +878,6 @@ public virtual inherited sharing class SOQL implements Queryable {
}
}

public QueryBuilder resetBinding() {
binder = new Binder();
return this;
}

public override String toString() {
String query = '';

Expand Down

0 comments on commit 98b45ce

Please sign in to comment.