Issue with Radio button Field

Certified Senior Developer

Hii,

I am unable to select NA option , for YES or NO Its  working fine , how can i resolve this, 

i have to save

 a!radioButtonField(
                  label: "",
                  choiceLabels: { "Yes", "No", "N/A" },
                  choiceValues: { 1, 0, "NA" },
                  value: fv!item['recordType!{f42d5bd8-9c50-4910-b251-13ec6bf9fdb6}GAI App Review.fields.{899275d5-d9e3-4030-9291-883eaf45d2c6}reviewerAnswerBool'],
                  saveInto: {
                    local!a,
                    a!save(
                      fv!item['recordType!{f42d5bd8-9c50-4910-b251-13ec6bf9fdb6}GAI App Review.fields.{899275d5-d9e3-4030-9291-883eaf45d2c6}reviewerAnswerBool'],
                      if(local!a = "NA", {}, local!a)
                    )
                  },
this value in to boolean type column

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Your main issue here is that you also need to do some trickery in the "value" field to make it work.  Without some more advanced trickery, you will need to settle on the radio button starting off with a default selection of "N/A" when the user has not yet made any selection.  Otherwise an approach like the following should be very easy:

    a!localVariables(
      local!booleanValue: toboolean(null()),
      
      a!radioButtonField(
        label: "3-way boolean selector",
        choiceLabels: {
          "Yes",
          "No",
          "Null Value"
        },
        choiceValues: {
          true(),
          false(),
          "null"
        },
        value: if(
          a!isNullOrEmpty(local!booleanValue),
          "null",
          local!booleanValue
        ),
        saveInto: {
          a!save(
            local!booleanValue,
            if(
              save!value = "null",
              null(),
              save!value
            )
          )
        }
      )
    )

Reply
  • 0
    Certified Lead Developer

    Your main issue here is that you also need to do some trickery in the "value" field to make it work.  Without some more advanced trickery, you will need to settle on the radio button starting off with a default selection of "N/A" when the user has not yet made any selection.  Otherwise an approach like the following should be very easy:

    a!localVariables(
      local!booleanValue: toboolean(null()),
      
      a!radioButtonField(
        label: "3-way boolean selector",
        choiceLabels: {
          "Yes",
          "No",
          "Null Value"
        },
        choiceValues: {
          true(),
          false(),
          "null"
        },
        value: if(
          a!isNullOrEmpty(local!booleanValue),
          "null",
          local!booleanValue
        ),
        saveInto: {
          a!save(
            local!booleanValue,
            if(
              save!value = "null",
              null(),
              save!value
            )
          )
        }
      )
    )

Children
No Data