Multiple 'saveinto' not working with condition in button widget

Certified Associate Developer

                  a!columnLayout(
                    contents: {
                      a!buttonArrayLayout(
                        buttons: {
                          a!buttonWidget(
                            label: "Next",
                            size: "LARGE",
                            style: "SOLID",
                            saveInto: {
                              if(
                                len(ri!checklists) > 1,
                                {
                                  a!save(ri!steps, append(ri!steps, "name")),
                                  a!save(ri!nextStep, 3)
                                },
                                {
                                  a!save(
                                    local!showAddChecklistErrorMessage,
                                    true()
                                  )
                                }
                              )
                            }
                          )
                        },
                        align: "END",
                        marginBelow: "NONE"
                      )
                    }
                  )

Here is the code, I have button with save something based on a condition, now within this 2 save statement 

a!save(
ri!steps,
append(ri!steps, "name")
),
a!save(ri!nextStep, 3)
only first one is working next is not working. Let me know what I am doing wrong

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Associate Developer
    in reply to Sowvik Roy

    Its because the 2nd a!save has wrapped inside {}. 

    a!columnLayout(
    contents: {
    a!buttonArrayLayout(
    buttons: {
    a!buttonWidget(
    label: "Next",
    size: "LARGE",
    style: "SOLID",
    saveInto: {
    if(
    len(ri!checklists) > 1,
    {
    a!save(ri!steps, append(ri!steps, "name")),
    a!save(ri!nextStep, 3)
    },
    a!save(
    local!showAddChecklistErrorMessage,
    true()
    )
    )
    }
    )
    },
    align: "END",
    marginBelow: "NONE"
    )
    }
    )


Children