Validation of a constant in Dropdown

I have a dropdown in which the values are called from a constant. Will it be possible to customize which items will only come out?

Let's say the status of the request is cancelled, then I should only cancelled in the dropdown. Then if the status is reviewing, I should only see reviewing and revising. etc

Dropdown:

Constant:

Code for Reference:

a!dropdownField(
label: "Request Approval",
labelPosition: "ABOVE",
placeholder: "--- Select a Value ---",
choiceLabels: cons!CRP_REVIEWSTATUS_LIST,
choiceValues: cons!CRP_REVIEWSTATUS_LIST,
value: ri!review.reviewStatus,
saveInto: ri!review.reviewStatus,
searchDisplay: "AUTO",
required: false,
validations: {}
)

  Discussion posts and replies are publicly visible

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

    Got it.

    Our approach to status value is, that we have an individual constant for each value. Then we can reference each value clearly and also use it for comparisons.

    To get a list of all values, we then create an expression which returns a list of all the constants.

    In a task form, you could then just list the values you need for that form.

    And if you use a reusable component, you could create a local holding the values matching the current status. A decision table can do that as well.

Children