multidropdown items selection during "Update" related action

Hi,

I have an interface which I am using for Employee details capture.

I am using the same form for the creation of a new record in the database and for the updation.

I have created a RecordType and created "Update Employee" related action.

Now when I click on the "Update Employee" button I am getting an error like 

"Error Evaluating UI Expression Expression evaluation error [evaluation ID = 335d6:04711] in rule 'at_captureemployee' at function a!multipleDropdownField [line 68]: A multiple dropdown component [label="Languages Known"] has an invalid value for "value". All selected values must be present in the choiceValues array, but value was [languageid:25,languagenumber:1]; [languageid:26,languagenumber:4]; [languageid:27,languagenumber:2] and choiceValues was 1; 4; 2; 5; 3."

Can someone help on this.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi hari,
    your issue is, that you choiceValues are elements of "languageNumber" and your value is a "whole" CDT:
    To make this work some inputs:

    local!languages:....,
    local!selectedLanguages: ri!employeeLanguage,
    local!selectedLanguageNumbers: index(selectedLanguages,"languageNumber",null),
    ....
    
    a!multidropdownfield(
    ....
        choiceValue: tointeger(index(local!languages,"languageNumber",null)),
        value: tointeger(local!selectedLanguageNumbers),
        saveInto:{
           local!selectedLanguageNumbers,
           a!save(
            target: local!selectedLanguages,
            value: index(
                local!languages,
                wherecontains(
                    tointeger(local!selectedLanguageNumbers),
                    tointeger(index(local!languages, "languageNumber,{}))
                ),
                null
            )
           )
        }
    )

    is languageNumber your primaryKey? if not , try to use the primary key instead

Reply
  • 0
    Certified Senior Developer

    Hi hari,
    your issue is, that you choiceValues are elements of "languageNumber" and your value is a "whole" CDT:
    To make this work some inputs:

    local!languages:....,
    local!selectedLanguages: ri!employeeLanguage,
    local!selectedLanguageNumbers: index(selectedLanguages,"languageNumber",null),
    ....
    
    a!multidropdownfield(
    ....
        choiceValue: tointeger(index(local!languages,"languageNumber",null)),
        value: tointeger(local!selectedLanguageNumbers),
        saveInto:{
           local!selectedLanguageNumbers,
           a!save(
            target: local!selectedLanguages,
            value: index(
                local!languages,
                wherecontains(
                    tointeger(local!selectedLanguageNumbers),
                    tointeger(index(local!languages, "languageNumber,{}))
                ),
                null
            )
           )
        }
    )

    is languageNumber your primaryKey? if not , try to use the primary key instead

Children