Add Row Action Failing due to Valid If - Help with Expression

Iโ€™m using the action: โ€œadd a row to another table using values from this tableโ€ and the record is failing due to the Valid If statement. In the case below, I have a record Iโ€™m trying to insert that has a Cart Weight of 2561. The expression should allow the record being inserted is function: SCALE_RECV. The expression seems to not recognize the function and enforces the validation. I could really use some help with the right expression.

The following is the Valid If Expression:

IFS(
[function]=โ€œSCALE_RECVโ€,[_THIS]>0,
AND([function]=โ€œWHSE_RECVโ€,[Cart Material].[name]=โ€œTrashโ€),AND([_THIS]>0,[_THIS]<3000),
AND([function]=โ€œWHSE_RECVโ€,[Cart Material].[name]=โ€œClothesโ€),AND([_THIS]>0,[_THIS]<1000),
TRUE,[_THIS]>0,
)

I also tried:

IFS(
CONTEXT(View)=โ€œScale Receiving Detailโ€,[_THIS]>0,
AND([receiving_id].[Function]=โ€œWHSE_RECVโ€,[Cart Material].[name]=โ€œTrashโ€),AND([_THIS]>0,[_THIS]<3000),
AND([receiving_id].[Function]=โ€œWHSE_RECVโ€,[Cart Material].[name]=โ€œClothesโ€),AND([_THIS]>0,[_THIS]<1000),
TRUE,[_THIS]>0,
)

Here is the action that inserts the record.

ERROR REFERENCE:
โ€œErrorsโ€: โ€œError: Perform DataAction โ€˜create_scale_carts_clothesโ€™ failed because Row having key โ€˜c311532aโ€™ in table โ€˜Cartsโ€™ containing value โ€˜2940โ€™ in field โ€˜Cart Weightโ€™ failed โ€˜Valid_Ifโ€™ condition. Error: Perform DataAction โ€˜create_scale_carts_clothesโ€™ failed because Row having key โ€˜c311532aโ€™ in table โ€˜Cartsโ€™ containing value โ€˜โ€™ in field โ€˜Cart Barcodeโ€™ failed โ€˜Required_Ifโ€™ condition. Error: โ€˜Add Rowโ€™ Data action โ€˜create_scale_carts_clothesโ€™ failed with exception Collection was modified; enumeration operation may not execute. .โ€,

0 2 228
2 REPLIES 2

Steve
Platinum 4
Platinum 4

Does a Valid If expression of just TRUE work?

The Valid If is required if the recordโ€™s function = โ€œWHSE_RECVโ€.

Just tried:

IF([function]=SCALE_RECV,FALSE,
IFS(
[Cart Material].[name]=โ€œTrashโ€, AND([_THIS]>0,[_THIS]<3000),
[Cart Material].[name]=โ€œClothesโ€,AND([_THIS]>0,[_THIS]<1000),
)
)

Andโ€ฆ
IF([function]=SCALE_RECV,FALSE,
IFS(
[Cart Material].[name]=โ€œTrashโ€, AND([_THIS]>0,[_THIS]<3000),
[Cart Material].[name]=โ€œClothesโ€,AND([_THIS]>0,[_THIS]<1000),
)
)

Top Labels in this Space