Unable to get the data with multiple ID's

Hi Team,

I was using the below rule and trying to fetch the data with the condition that selecting one ID from a grid should get one CaseID: 50324 and if selecting more than one ID should get CaseID: Multiple ID. can anyone please help me on this 

a!localVariables(
local!data: a!queryEntity(
entity: cons!BEMS_ENTITY_PAYABLE_CASE_VIEW,
query: a!query(
/*selection: a!querySelection(a!queryColumn(field: "clientName")),*/
aggregation: a!queryAggregation(
a!queryAggregationColumn(field: "clientName", isGrouping: true)
),
filter: a!queryFilter(
field: "caseId",
operator: "in",
value: a!flatten({ ri!caseIds })
),
pagingInfo: rule!TCO_defaultPagingInfo()
)
),
{
if(
local!data.totalCount > 0,
if(
local!data.totalCount = 1,
left(
"Standard Template - " & proper(
joinarray(local!data.data.clientName, " & ")
) & " - " & "CaseId:" & joinarray(ri!caseIds, ", "),
80
),
if(
local!data.totalCount >= 2,
left(
"Standard Template - " & proper(
joinarray(local!data.data.clientName, " & ")
) & " - " & "Multiple Case Id ",
80
),
{}
)
),
{}
)
}
)

  Discussion posts and replies are publicly visible

Parents Reply Children
  • In the below code that totalCount of ri!caseIds is 0 then it should write null value but its writing no value 

    {
    if(
    local!data.totalCount > 0,
    if(
    local!data.totalCount = 1,
    if(
    count(ri!caseIds) = 1,
    left(
    "Standard Template - " & proper(
    joinarray(local!data.data.clientName, " & ")
    ) & " - " & "CaseId:" & joinarray(ri!caseIds, ", "),
    80
    ),
    left(
    "Standard Template - " & proper(
    joinarray(local!data.data.clientName, " & ")
    ) & " - " & "Multiple Case Id ",
    80
    )
    ),
    if(
    local!data.totalCount >= 2,
    left(
    "Standard Template - " & proper(
    joinarray(local!data.data.clientName, " & ")
    ) & " - " & "Multiple Case Id ",
    80
    ),
    {}
    )
    ),
    {}
    )
    }