validation in gridfield

Hi Friends,


Created a grid with 10 rows in each page( Data comes dynamically from service)
Grid contains column with amount of plus and minus values
user selects the rows by clicking on add buttton and all the rows will be shown in the below grid.
Validation message should be displayed when user selects a row with minus value.

I can able to put the validation but below scenarios is failing

User selects positive value in first page and selects negartive value in second page (where it displays the validation message correctly)
but when comes back to the page and clicks on add button both rows are getting added to the below grid.

Can you please help me in this grid validation how to restrict the add only one row.

I have used below code

if(
or(
a!forEach(
items: local!allTransactions.data[whereContains(
apply(
fn!tostring, {
local!gridSelection1.selected
}
), apply(
fn!tostring, {
index(
local!allTransactions.data, "SerialNumber", " "
)
}
)
)],
expression: todecimal(
fv!item.Amount
) < 0
)
),
"One or more rows you have selected is minus value",
{}
)

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data