Skip to main content
March 23, 2023
Solved

Cast Invalid error

  • March 23, 2023
  • 1 reply
  • 0 views

Hi,

I am getting below cast invalid error for below rule. Please help in resolving this.

The same code is working fine in one of our environments but not in another environment.

"Expression evaluation error at function a!queryEntity_22r2: Could not cast from Boolean to Data Store Entity. Details: CastInvalidCould not cast from Boolean to Data Store Entity. Details: CastInvalid"

a!queryEntity_22r2(
  entity: cons!RGRACSLBL_ENTITY_NEW_PROJECTS_EVENTS_VIEW,
  query: a!query(
      logicalExpression: a!queryLogicalExpression(
      operator: "AND",
      filters: {
        a!queryFilter(
          field: "processId_int",
          operator: "not null"
        ),
        a!queryFilter(
          field: "isExistingCountry_bool",
          operator: "=",
          value: ri!isExistingCountry_bool
        )
      
        
      }
    ),
    
    pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: - 1
    )
  ),
  fetchTotalCount:true()
).data

    Best answer by sanchitg0002

    This occurs when the constant you are using to point DSE do not have a value of type DSE but Boolean. Check the value of constant on whatever environment it is throwing this error.

    1 reply

    March 23, 2023

    This occurs when the constant you are using to point DSE do not have a value of type DSE but Boolean. Check the value of constant on whatever environment it is throwing this error.