I have a dropdown list.If no selection is made, the system saves a null value in

I have a dropdown list.If no selection is made, the system saves a null value into the component's Save Selection To field.Confused by this Error - "A dropdown component [label=“Company”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was and choiceValues was ABI2WG ; ACC1LON ; ACEI4BRI; ACI2SYD ; ".
Expression Error : "Expression evaluation error in rule 'vc_mc_brokercontactdetail' (called by rule 'vc_mc_managecontacts'): A null parameter has been passed."
Below is the code which renders it
a!dropdownField(
label: cons!VC_LB_COMPANY,
labelPosition: cons!VC_LB_POSITION_ADJACENT,

choiceLabels: {
apply(fn!tostring,local!brokerCompany.id)
},
choiceValues: {
apply(fn!tostring,local!brokerCompany.id)
},
placeholderLabel: cons!VC_CMS_LB_PLACEHOLDER_SELECT...

OriginalPostID-150440

OriginalPostID-150440

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    Hi, I just had the same issue, I had to encapsulate the value in a 'tostring' so that the types matched.

    So value: tostring(local!broker.customer_Code)

     

    a!dropdownField(
    label: cons!VC_LB_COMPANY,
    labelPosition: cons!VC_LB_POSITION_ADJACENT,

    choiceLabels: {
    apply(fn!tostring,local!brokerCompany.id)
    },
    choiceValues: {
    apply(fn!tostring,local!brokerCompany.id)
    },
    placeholderLabel: cons!VC_CMS_LB_PLACEHOLDER_SELECT,

    value: tostring(local!broker.customer_Code),
    saveInto: local!broker.customer_Code
    )

Reply
  • +1
    Certified Senior Developer

    Hi, I just had the same issue, I had to encapsulate the value in a 'tostring' so that the types matched.

    So value: tostring(local!broker.customer_Code)

     

    a!dropdownField(
    label: cons!VC_LB_COMPANY,
    labelPosition: cons!VC_LB_POSITION_ADJACENT,

    choiceLabels: {
    apply(fn!tostring,local!brokerCompany.id)
    },
    choiceValues: {
    apply(fn!tostring,local!brokerCompany.id)
    },
    placeholderLabel: cons!VC_CMS_LB_PLACEHOLDER_SELECT,

    value: tostring(local!broker.customer_Code),
    saveInto: local!broker.customer_Code
    )

Children
No Data