Why wont this save?

Certified Associate Developer

Hi,

So Im trying to get this code to save below into my ri! field but no matter what I do it will not save. Can someone please tell me whats wrong here?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • +1
    Certified Lead Developer
    in reply to ashleym0002

    Hi

    Below sample may be helpful for this case,

    a!localVariables(
      local!firstItem_txt,
      local!secondItem_txt,
      local!thirItem_txt,
      local!combinedItem_txt,/*ri!orders.products*/
      {
        a!sectionLayout(
          label: "Section",
          contents: {
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!dropdownField(
                      label: "Dropdown 1",
                      labelPosition: "ABOVE",
                      placeholder: "--- Select a Value ---",
                      choiceLabels: {
                        "Option 1",
                        "Option 2",
                        "Option 3",
                        "Option 4",
                        "Option 5",
                        "Option 6",
                        "Option 7",
                        "Option 8",
                        "Option 9",
                        "Option 10",
                        "Option 11",
                        "Option 12"
                      },
                      choiceValues: {
                        "Option 1",
                        "Option 2",
                        "Option 3",
                        "Option 4",
                        "Option 5",
                        "Option 6",
                        "Option 7",
                        "Option 8",
                        "Option 9",
                        "Option 10",
                        "Option 11",
                        "Option 12"
                      },
                      value: local!firstItem_txt,
                      saveInto: {
                        local!firstItem_txt,
                        if(
                          or(
                            isnull(local!firstItem_txt),
                            isnull(local!secondItem_txt),
                            isnull(local!thirItem_txt)
                          ),
                          {},
                          a!save(
                            local!combinedItem_txt,
                            joinarray(
                              {
                                local!firstItem_txt,
                                local!secondItem_txt,
                                local!thirItem_txt
                              },
                              ","
                            )
                          )
                        )
                      }
                    )
                  }
                ),
                a!columnLayout(
                  contents: {
                    a!dropdownField(
                      label: "Dropdown 2",
                      labelPosition: "ABOVE",
                      placeholder: "--- Select a Value ---",
                      choiceLabels: {
                        "Option 1",
                        "Option 2",
                        "Option 3",
                        "Option 4",
                        "Option 5",
                        "Option 6",
                        "Option 7",
                        "Option 8",
                        "Option 9",
                        "Option 10",
                        "Option 11",
                        "Option 12"
                      },
                      choiceValues: {
                        "Option 1",
                        "Option 2",
                        "Option 3",
                        "Option 4",
                        "Option 5",
                        "Option 6",
                        "Option 7",
                        "Option 8",
                        "Option 9",
                        "Option 10",
                        "Option 11",
                        "Option 12"
                      },
                      value: local!secondItem_txt,
                      saveInto: {
                        local!secondItem_txt,
                        if(
                          or(
                            isnull(local!firstItem_txt),
                            isnull(local!secondItem_txt),
                            isnull(local!thirItem_txt)
                          ),
                          {},
                          a!save(
                            local!combinedItem_txt,
                            joinarray(
                              {
                                local!firstItem_txt,
                                local!secondItem_txt,
                                local!thirItem_txt
                              },
                              ","
                            )
                          )
                        )
                      }
                    )
                  }
                ),
                a!columnLayout(
                  contents: {
                    a!dropdownField(
                      label: "Dropdown 3",
                      labelPosition: "ABOVE",
                      placeholder: "--- Select a Value ---",
                      choiceLabels: {
                        "Option 1",
                        "Option 2",
                        "Option 3",
                        "Option 4",
                        "Option 5",
                        "Option 6",
                        "Option 7",
                        "Option 8",
                        "Option 9",
                        "Option 10",
                        "Option 11",
                        "Option 12"
                      },
                      choiceValues: {
                        "Option 1",
                        "Option 2",
                        "Option 3",
                        "Option 4",
                        "Option 5",
                        "Option 6",
                        "Option 7",
                        "Option 8",
                        "Option 9",
                        "Option 10",
                        "Option 11",
                        "Option 12"
                      },
                      value: local!thirItem_txt,
                      saveInto: {
                        local!thirItem_txt,
                        if(
                          or(
                            isnull(local!firstItem_txt),
                            isnull(local!secondItem_txt),
                            isnull(local!thirItem_txt)
                          ),
                          {},
                          a!save(
                            local!combinedItem_txt,
                            joinarray(
                              {
                                local!firstItem_txt,
                                local!secondItem_txt,
                                local!thirItem_txt
                              },
                              ","
                            )
                          )
                        )
                      }
                    )
                  }
                )
              }
            )
          }
        ),
        a!textField(
          showWhen: not(isnull(local!combinedItem_txt)),
          label: "Result",
          labelPosition: "ABOVE",
          readOnly: true,
          value: local!combinedItem_txt
        )
      }
    )