I have a query entity where i am passing date column AA to fetch some info from table. Now based on Source,i need to use different date columns.Example: For Source A i have to pass column DateAAAA, for source BB pass DateBBB etc.
I dont find a way to pass the source here. Like if source is A,then do this ...
a!queryFilter( field: "dateFilterXXXX", operator: ">=", value: gmt( todatetime( workday( local(now(), "America/New_York"), -10, ri!holidays ) & " " & totime("16:00 PM") ) ) ),
else....
a!queryFilter( field: "dateFilterBBBB", operator: ">=", value: gmt( todatetime( workday( local(now(), "America/New_York"), -10, ri!holidays ) & " " & totime("16:00 PM") ) ) ),
I am not passing parameters from any other place into this rule, so i dont find a way to pass the source. I need to get the source first and then define filters accordingly.
Please suggest on how i can get the source from entity and then pass filters here. I tried to querycolumn for source but unable to notate it or index it anywhere.
a!queryEntity( entity: cons!TABLE_NAME, query: a!query( selection: a!querySelection( columns: { a!queryColumn(field: "id"), a!queryColumn(field: "type"), a!queryColumn(field: "source")..... } ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "fieldAAAA", operator: "<>", value: "AAAA" ), a!queryFilter( field: "fieldBBB", operator: "<>", value: "BBBB" ), a!queryFilter( field: "dateFilterXXXX", operator: ">=", value: gmt( todatetime( workday( local(now(), "America/New_York"), -10, ri!holidays ) & " " & totime("16:00 PM") ) ) ) }, logicalExpressions: { a!queryLogicalExpression( operator: "OR", logicalExpressions: { a!forEach( items: ri!dailyPriorityCriteria, expression: { a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "type", operator: if( rule!APN_isEmpty(fv!item.type), "is null", "=" ), value: fv!item.type ), a!queryFilter( field: "status", operator: "=", value: fv!item.status ), a!queryFilter( field: "priority", operator: "<", value: "" ) } )/*END AND*/ } )/*END FOR EACH*/ } )/*END OR*/ }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: cons!FAS_MAX_CASES_TO_INCREASE_PRIORITY ) ), fetchTotalCount: false ).data
Discussion posts and replies are publicly visible
Hello Mike,
Thanks for the response.
I did tried this approach earlier, it is returning me data but instead of 22 it is giving me 49 rows etc which is not appropriate. So i am kind of lost on it.
As you read through the rows of returned data (including the unexpected extras), what rows are being returned that don't match the desired parameters? In what way do those rows fail to meet your expectations? This is important to know to determine what the issue might be. If you're able to try again, could you post the full code of that version of the query?