Could not display interface. Please check definition and inputs.

I was able to trace this issue down to the interface object. The new error from the design view when I click the EDIT link is:

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!dropdownField [line 454]: A dropdown component [label="Relationship to Child"] has an invalid value for "choiceValues". Duplicate items are not allowed in the choiceValues array, but choiceValues was 4; 15; 54; 23; 27; 28; 29; 37; 41; 42; 43; 40; 44; 1; 2; 3; 4; 5; 6; 7; 8; 46; 9; 10; 11; 12; 13; 14; 15; 47; 16; 49; 48; 17; 18; 19; 54; 50; 51; 52; 53; 55; 20; 21; 56; 78; 39; 22; 57; 58; 59; 60; 23; 24; 25; 26; 61; 62; 63; 27; 28; 45; 29; 64; 65; 30; 77; 70; 66; 67; 68; 69; 31; 32; 33; 34; 71; 72; 35; 73; 74; 36; 37; 75; 38.

item: a!dropdownField(
            label: if(
              local!isDependent,
              "Relationship to Parent",
              "Relationship to Child"
            ),
            placeholder: "Please select a relationship",
            choiceLabels: if(
              local!isDependent,
              if(
                contains(tointeger(local!lkupDepChildRelationshipType.childRelationshipTypeId),ri!droRecPersonLinks.childRelationshipTypeId),
                local!lkupDepChildRelationshipType.childRelationshipTypeDesc,
                index(
                  append(
                    local!lkupDepChildRelationshipType,
                    rule!droQueryLkupChildRelationshipTypeEntity(childRelationshipTypeId: ri!droRecPersonLinks.childRelationshipTypeId)
                  ),
                  "childRelationshipTypeDesc"
                )
              ),
              if(
                contains(tointeger(local!lkupPrimaryChildRelationshipType.childRelationshipTypeId),ri!droRecPersonLinks.childRelationshipTypeId),
                local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc,
                index(
                  append(
                    local!lkupPrimaryChildRelationshipType,
                    rule!droQueryLkupChildRelationshipTypeEntity(childRelationshipTypeId: ri!droRecPersonLinks.childRelationshipTypeId)
                  ),
                  "childRelationshipTypeDesc"
                )
              )
              /*remove(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc), wherecontains({"OBLIGEE"}, trim(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc))))*/
            ),
            choiceValues: if(
              local!isDependent,
              if(
                contains(tointeger(local!lkupDepChildRelationshipType.childRelationshipTypeId),ri!droRecPersonLinks.childRelationshipTypeId),
                local!lkupDepChildRelationshipType.childRelationshipTypeId,
                index(
                  append(
                    local!lkupDepChildRelationshipType,
                    rule!droQueryLkupChildRelationshipTypeEntity(childRelationshipTypeId: ri!droRecPersonLinks.childRelationshipTypeId)
                  ),
                  "childRelationshipTypeId"
                )
              ),
              /*remove(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc), wherecontains({"OBLIGEE"}, trim(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc))))*/
              if(
                contains(tointeger(local!lkupPrimaryChildRelationshipType.childRelationshipTypeId),ri!droRecPersonLinks.childRelationshipTypeId),
                local!lkupPrimaryChildRelationshipType.childRelationshipTypeId,
                index(
                  append(
                    local!lkupPrimaryChildRelationshipType,
                    rule!droQueryLkupChildRelationshipTypeEntity(childRelationshipTypeId: ri!droRecPersonLinks.childRelationshipTypeId)
                  ),
                  "childRelationshipTypeId"
                )
              )
            ),
            value: ri!droRecPersonLinks.childRelationshipTypeId,
            saveInto: ri!droRecPersonLinks.childRelationshipTypeId,
            disabled: not(local!isEditable)
          ),

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    If I may offer a bit of code review advice... you're doing a lot of manual work in unnecessarily duplicative ways in this code, for no apparent reason.  For one example, you're calling this query, `rule!droQueryLkupChildRelationshipTypeEntity(childRelationshipTypeId: ri!droRecPersonLinks.childRelationshipTypeId)`, at least 4 different times even though it's being called in exactly the same way each time.  This sort of thing is a strong indicator that you're not leveraging local variables enough (or correctly at all).

    Secondarily your choiceValues and choiceLabels arrays appear to be using almost the exact same code, with the only difference being that one is pulling out the Id property and the other is pulling out the Desc property.  What you *should* be doing is running all that code once in a local variable definition, to assemble a dictionary array containing both of those properties, then simply referring to that local variable like "local!myList.Id", "local!myList.Desc" in your dropdown component configuration.  This would be much easier to troubleshoot and maintain in the future.

  • Thank you, Mike.

    for some reason am not sure of; the code below works with no errors:

     item: a!dropdownField(
                label: if(
                  local!isDependent,
                  "Relationship to Parent",
                  "Relationship to Child"
                ),
                placeholder: "Please select a relationship",
                choiceLabels: if(
                  local!isDependent,
                  local!lkupDepChildRelationshipType.childRelationshipTypeDesc,
                  local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc
                  /*remove(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc), wherecontains({"OBLIGEE"}, trim(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc))))*/
                ),
                choiceValues: if(
                  local!isDependent,
                  local!lkupDepChildRelationshipType.childRelationshipTypeId,
                  /*remove(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc), wherecontains({"OBLIGEE"}, trim(touniformstring(local!lkupPrimaryChildRelationshipType.childRelationshipTypeDesc))))*/
                  local!lkupPrimaryChildRelationshipType.childRelationshipTypeId
                ),
                value: ri!droRecPersonLinks.childRelationshipTypeId,
                saveInto: ri!droRecPersonLinks.childRelationshipTypeId,
                disabled: not(local!isEditable)
              ),

  • 0
    Certified Lead Developer
    in reply to nicholaso0002

    I'm afraid you'll need to do some troubleshooting here.  Again this would be far simpler if you would establish a single local variable array to hold the dictionary values for your choiceLabels / values; since then you could review what the array values are.

    The initial error message you posted in the original post makes it pretty clear, though, as pointed out in the initial reply by Chris - your choiceValues array has duplicates, which is not allowed.  The error output you pasted has many duplicate values.  It looks like the whole first part of the set ({4, 15 ... 29; 37}) contains items duplicated at least once elsewhere in the array.  I assume the likely culprit is the "append()" you're doing - this will need to be revised.

Reply
  • 0
    Certified Lead Developer
    in reply to nicholaso0002

    I'm afraid you'll need to do some troubleshooting here.  Again this would be far simpler if you would establish a single local variable array to hold the dictionary values for your choiceLabels / values; since then you could review what the array values are.

    The initial error message you posted in the original post makes it pretty clear, though, as pointed out in the initial reply by Chris - your choiceValues array has duplicates, which is not allowed.  The error output you pasted has many duplicate values.  It looks like the whole first part of the set ({4, 15 ... 29; 37}) contains items duplicated at least once elsewhere in the array.  I assume the likely culprit is the "append()" you're doing - this will need to be revised.

Children
No Data