Error when modifying an array in the rule input, it only happens on the site

Hello, I have a "little" problem.

I have an array that I want to modify using a! save, inside my foreach. Everything works fine on the interface.

a!sideBySideItem(
                      item: a!buttonArrayLayout(
                        buttons: {
                          a!buttonWidget(
                            label: "",
                            icon: "trash-o",
                            size: "SMALL",
                            width: "MINIMIZE",
                            style: "DESTRUCTIVE",
                            loadingIndicator: true,
                            saveInto: {
                              a!save(
                                target: ri!moneyAccounts[fv!index].isDeleted,
                                value: true()
                              ),

                            }
                          ),
                          a!buttonWidget(
                            label: "",
                            icon: "pencil-square-o",
                            size: "SMALL",
                            width: "MINIMIZE",
                            style: "PRIMARY"
                          )
                        },
                        align: "START"
                      ),
                      width: "MINIMIZE"
                    )

But when I want to use it on the site I get this error. Please help

  Discussion posts and replies are publicly visible

Parents Reply
  • +2
    Certified Lead Developer
    in reply to brayanm0001

    Thanks.

    well, if you see the moneyAccounts parameter value is not set to a rule input / local variable / process variable and that's the reason it is giving you an error.


    So, if you do something like the below, it will work.

    a!localVariables(
      local!accounts: rule!BMC_GetMoneyAccounts(uuidUser: user(loggedInUser(), "uuid")).data,
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              rule!BMC_ListMoneyAccounts(moneyAccounts: local!accounts)
            },
            width: "AUTO"
          )
        },
        stackWhen: {
          "PHONE",
          "TABLET_PORTRAIT",
          "TABLET_LANDSCAPE",
          "DESKTOP_NARROW"
        }
      )
    )

Children