is it possible to put the below expression in query rule where condition?

is it possible to put the below expression in query rule where condition?

month(EMP_HIRE_DATE) &"-"& year(EMP_HIRE_DATE)=year(now()) & month(now())-1

OriginalPostID-199845

OriginalPostID-199845

  Discussion posts and replies are publicly visible

Parents
  • is it possible put the same condition in queryEntity?
    sample code is :
    a!queryEntity(
    entity: cons!EMPLOYEE_ENTITY,
    query: a!query(
    selection: a!querySelection(
    columns: {
    a!queryColumn(field: "hiredate"),
    a!queryColumn(field: "empid")
    }
    ),
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "hiredate",
    operator: "<",
    value: date(year(now()), month(now())-1, day(now()))
    ),
    a!queryFilter(
    field: "empid",
    operator: "=",
    value: ri!empid
    )
    }
    ),
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: -1
    )
    )
    )
    getting the below error message
    Expression evaluation error at function a!queryEntity: Cannot apply operator [LESS_THAN] to field [dtCreated] when comparing to value [TypedValue[it=7,v=2016-02-10]].
Reply
  • is it possible put the same condition in queryEntity?
    sample code is :
    a!queryEntity(
    entity: cons!EMPLOYEE_ENTITY,
    query: a!query(
    selection: a!querySelection(
    columns: {
    a!queryColumn(field: "hiredate"),
    a!queryColumn(field: "empid")
    }
    ),
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "hiredate",
    operator: "<",
    value: date(year(now()), month(now())-1, day(now()))
    ),
    a!queryFilter(
    field: "empid",
    operator: "=",
    value: ri!empid
    )
    }
    ),
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: -1
    )
    )
    )
    getting the below error message
    Expression evaluation error at function a!queryEntity: Cannot apply operator [LESS_THAN] to field [dtCreated] when comparing to value [TypedValue[it=7,v=2016-02-10]].
Children
No Data