Hi, I have been experiencing an issue where I am trying to save the v

Hi,

I have been experiencing an issue where I am trying to save the values that are calculated automatically in an inline editable grid but they are not being saved in a variable. I've tried using all the functions to save those values but they're not getting saved anywhere.

for example, If I calculate amount through quantity*price then quantity and price are getting saved but not the Amount.

a!textField(
label: "amount " & ri!index,
align: "RIGHT",
readOnly: true,
value: if(or(isnull(ri!items[ri!index].qty), isnull(ri!items[ri!index].unitPrice)), null,
dollar(tointeger(ri!items[ri!index].qty) * todecimal(ri!items[ri!index].unitPrice))),
saveInto: ri!items[ri!index].amount
)

So Can anyone help me saving auto-populated values in a grid?

Thanks,
Varnika

OriginalPostID-209066

OriginalPostID-209066

  Discussion posts and replies are publicly visible

Parents
  • Sikhivahans, Thank you for your responses. As you've suggested to save the amount in to save into function of the expression used for price, I tried to incorporate the same functionality but that didn't work -

    Here is the expression I used to save the amount :

    a!integerField(
    label: "qty " & ri!index,
    align: "RIGHT",
    validations: if(tointeger(ri!items[ri!index].qty) < 1, "Quantity must be greater than 0", null),
    value: ri!items[ri!index].qty,
    saveInto: ri!items[ri!index].qty
    ),
    a!floatingPointField(
    label: "unitPrice " & ri!index,
    align: "RIGHT",
    validations: if(todecimal(ri!items[ri!index].unitPrice) < 1, "Unit price must be greater than 0", null),
    value: ri!items[ri!index].unitPrice,
    saveInto: {ri!items[ri!index].unitPrice, ri!items[ri!index].amount << fn!append(ri!items[ri!index].unitPrice*ri!items[ri!index].qty, _)}
    )

    Do you have any example that I can use to save the value?

    Thanks,
    Varnika

Reply
  • Sikhivahans, Thank you for your responses. As you've suggested to save the amount in to save into function of the expression used for price, I tried to incorporate the same functionality but that didn't work -

    Here is the expression I used to save the amount :

    a!integerField(
    label: "qty " & ri!index,
    align: "RIGHT",
    validations: if(tointeger(ri!items[ri!index].qty) < 1, "Quantity must be greater than 0", null),
    value: ri!items[ri!index].qty,
    saveInto: ri!items[ri!index].qty
    ),
    a!floatingPointField(
    label: "unitPrice " & ri!index,
    align: "RIGHT",
    validations: if(todecimal(ri!items[ri!index].unitPrice) < 1, "Unit price must be greater than 0", null),
    value: ri!items[ri!index].unitPrice,
    saveInto: {ri!items[ri!index].unitPrice, ri!items[ri!index].amount << fn!append(ri!items[ri!index].unitPrice*ri!items[ri!index].qty, _)}
    )

    Do you have any example that I can use to save the value?

    Thanks,
    Varnika

Children
No Data