Process parameters initialization issue

I have a proces model for updating employee data (not yet finished but it shouldn't matter):

This process starts with interface that looks like this:

It means that update process starts with choosing employee from the database through dropdown field.

I've created these process variables:

The problem is: If I try to run the process for debugging without initializing null values for these parameters I keep getting following error:

If I initialize them to nulls explicitly everything works fine. What could be the reason?

It seems that there is a problem with the initial employee dropdown field which is defined like this:

a!sectionLayout(
          label: "Employee Selection",
          contents: {
            a!dropdownField(
              label: "Employee",
              labelPosition: "ABOVE",
              placeholderLabel: "--- Select a Value ---",
              choiceLabels: a!forEach(
                items: local!employees,
                expression: fv!item.firstName & " " & fv!item.lastName
              ),
              choiceValues: a!forEach(
                items: local!employees,
                expression: fv!item.id
              ),
              value: ri!selectedEmployee,
              saveInto: ri!selectedEmployee,
              required: true,
              validations: {}
            )
          },
          showWhen: local!activeStep = 1
        ),

Local variable used for populating dropdown (local!employees) is defined like this:

a!localVariables(
  local!activeStep: 1,
  local!steps: {
    "Select employee",
    "Personal Data",
    "Address Data",
    "Review"
  },
  local!startAddressId,
  with(
    local!supervisors: rule!EEDM_GetAllSupervisors(),
    local!employees: rule!EEDM_GetAllEmployees(),
    local!allAddress: rule!EEDM_GetAllAddresses(),
    a!formLayout(
      label: "Update Employee"
      
      ...

There should be no problem with EEDM_GetAllEmployees which fetches all employees.

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to ivanm0004

    it means that my dropdown is trying to fetch employee with ID = 0 for it's default value and fails to do so as I don't have one with that ID?

    Basically.  Read the error message you put in your screenshot.  In it, it says the value you're trying to pass is 0, while the choiceValues array is a list of non-zero values.  This is a basic requirement of Dropdown Fields - the only exception they can handle is when the Value is "null()", and even then only if you have a placeholderlabel defined.

    Or somewhere in the interface code

    To be fair, I believe i did say "on your start form interface ...the value..." above, though my wording may have been less clear than I imagined it was.  So in other words, here:

Children