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
  • 0
    Certified Lead Developer

    It seems like your rule input is just a single integer. Make it a list and this should work.

    The a!flatten and the curly brackets in line 12 are not necessary.

  • In the below code on the if condition that no value is passing in the ri!caseIds i mean 0 then i should get null value but iam not getting anything.

    {
    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: ri!caseIds
    ),
    pagingInfo: rule!TCO_defaultPagingInfo()
    )
    ),
    {
    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
    ),
    {}
    )
    ),
    {}
    )
    }
    )
    }

Reply
  • In the below code on the if condition that no value is passing in the ri!caseIds i mean 0 then i should get null value but iam not getting anything.

    {
    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: ri!caseIds
    ),
    pagingInfo: rule!TCO_defaultPagingInfo()
    )
    ),
    {
    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
    ),
    {}
    )
    ),
    {}
    )
    }
    )
    }

Children