dropdown

Hi,

I have a dropdown with 2 values.

I have a scenario like once after selecting "Cancelled" I have to show a textfield to enter comments and save the details. This I am able to achieve.

But, at the same time I have to remove "Cancelled" option from the dropdown. When I am trying to do that I can getting below specified error.

ERROR:

code:

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Hari Kishore Reddy

    you are saying you are submitting the form, If you you submit the form how do you getting this form again, because once submit the form you will navigate back to your dashboard(Or where ever you initially came from). 

    Please try this code if you are writing something on submit button. 

    a!formLayout(
        contents: {
          a!dropdownField(
            label: "Review Options",
            placeholder: "-- Review Options --",
            choiceLabels: local!reviewOptionLables,
            choiceValues: local!reviewOptionValues,
            value: local!selectedReviewOption,
            saveInto: {
              local!selectedReviewOption,
              ri!opinionReviewOption, /*Assuming this is where you are saving final selection */
              /*Resetting your reason every time option is changed*/
              a!save(
                ri!reason,
                null
              )
            }
          ),
          a!textField(
            showWhen: ri!opinionReviewOption = "Cancelled",
            label: "Reason",
            value: ri!reason,
            saveInto: {
              ri!reason
            }
          )
        },
        buttons: {
          a!buttonLayout(
            primaryButtons: {
              a!buttonWidget(
                label: "Submit",
                style: "PRIMARY",
                saveInto: {
                  /*Assuming you are writing data to DB directly here*/
                  a!save(
                    local!selectedReviewOption, 
                    null
                  )
                }
              )
            }
          )
        }
      )

Children
No Data