Advanced Deluge help needed with custom function and COQL limits
I have a scheduled function that takes a snapshot of specific metrics and saves them to a custom module. However I'm struggling with the limits of COQL.
I attach my full code, but an example of the issues I'm having is that it's erroring with a 'Limit Exceeded' error. I believe this is because the COQL can only handle 50 records
Full error :
{ code: 'LIMIT_EXCEEDED' , details: {...} , message: 'value limit exceeded' , status: 'error' }
code : LIMIT_EXCEEDED
details : { by: 'where' , limit: 50 }
message : value limit exceeded
status : error
This is the section of code it's referring to :
- // === Step 4: Query using COQL with ID filter and BANT stages
- varBaseCrit = "'Committed, not Signed','In Quotation (Awaiting Proposal)','In Quotation (Awaiting Response)','In Quotation (Clarify Requirements)'";
- varBasePayload = Map();
- varBasePayload.put("select_query","SELECT Total_Amount, Stage, Closing_Date, Created_Time, Deal_Name FROM Deals WHERE Stage in (" + varBaseCrit + ") AND " + varIdClause);
- // Send the request
- varBaseResponse = invokeurl
- [
- url :"https://www.zohoapis.eu/crm/v5/coql"
- type :POST
- parameters:varBasePayload.toString()
- connection:"REDACTED"
- ];
- info varBaseResponse;
I have several of these sections throughout the code and the number of IDs in varIdClause has hit 54 which is why it's hit this limit.
How can I fix this - is there a solution ?