a!localVariables( local!maxData: a!queryEntity( entity: cons!ISP_DSE_CAPACITY_CONFIG, query: a!query( aggregation: a!queryAggregation( aggregationColumns: { a!queryAggregationColumn( field: "startDate", isGrouping: FALSE, aggregationFunction: "MAX" ), a!queryAggregationColumn(field: "distCenter", isGrouping: true), } ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "distCenter", operator: "=", value: ri!dc, applyWhen: a!isNotNullOrEmpty(ri!dc) ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50) ), fetchTotalCount: false ).data, local!date: tostring(index(local!maxData, "startDate", null)), a!queryEntity( entity: cons!ISP_DSE_CAPACITY_CONFIG, query: a!query( filter: { a!queryFilter( field: "startDate", operator: "=", value: local!date, applyWhen: a!isNotNullOrEmpty(local!date) ), a!queryFilter( field: "distCenter", operator: "=", value: ri!dc, applyWhen: a!isNotNullOrEmpty(ri!dc) ) }, pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50), ) ))
i have gone through the code several time but am getting the above error
Discussion posts and replies are publicly visible
Looks like a type mismatch. I would assume the date in the DB is an actual date field vs the local!date seems to be a string. Why are you converting it to a string exactly?
i tried without converting still same.. so i thought to convert to string
i tried without converting still same error
Your date is not a date, but a list of variant. That will not work.
try casting it to a date (via todate)