Need Dependent Year multidropdown filters

Hi ,

I want to diplay two filters one is Date and another one is on Year.

Date filter should be display of value of Year filter only.

By Year filter should display current year and Date should be current year date.

I have both in multidropdown separately without dependent to each other.

My requirement is to make dependent.

 local!year: year(
    today()
  ),
  
a!multipleDropdownField(
                  label: "Date",
                  choiceLabels:todate(
                    reject(
                      fn!isnull,
                      union(
                        local!dateList,
                        local!dateList
                      )
                    )
                  ),
                  choiceValues: reject(
                    fn!isnull,
                    union(
                      local!dateList,
                      local!dateList
                    )
                  ),
                  value: local!date,
                  saveInto: {
                    local!date,
                    a!save(
                      local!pagingInfo.startIndex,
                      1
                    )
                   
                  },
                  placeholderLabel: "All"
                ),
				 a!multipleDropdownField(
                  label: "Year",
                  choiceLabels: reject(
                    fn!isnull,
                    union(
                      local!yearList,
                      local!yearList
                    )
                  ),
                  choiceValues: reject(
                    fn!isnull,
                    union(
                      local!yearList,
                      local!yearList
                    )
                  ),
                  value: local!year,
                  saveInto: {
                    local!year,
                    a!save(
                      local!pagingInfo.startIndex,
                      1
                    )
                  placeholderLabel: "All"
                )

  Discussion posts and replies are publicly visible

Parents
  • load(
    local!currentYear: year(
    today()
    ),
    local!lastThreeYears: {
    local!currentYear,
    local!currentYear - 1,
    local!currentYear - 2
    },
    local!selectedYear,
    local!selectedDate,
    {
    a!multipleDropdownField(
    label: "Select Year",
    placeholder: "All",
    choiceLabels: local!lastThreeYears,
    choiceValues: local!lastThreeYears,
    value: local!selectedYear,
    saveInto: {
    local!selectedYear
    }
    ),
    a!dateField(
    disabled: isnull(
    local!selectedYear
    ),
    label: "Select Date",
    value: local!selectedDate,
    saveInto: local!selectedDate,
    validations: if(
    isnull(
    local!selectedDate
    ),
    null,
    if(
    contains(
    local!selectedYear,
    year(
    local!selectedDate
    )
    ),
    null,
    "Please select date within the selected year"
    )
    ),

    )
    }
    )

  • But i did this in another way which was bit optimize one.

    local!dateListFilter:index(local!dateList,wherecontains(local!year,year(local!dateList))),

    I have just filtered date before populating in dropdowns.

Reply Children
No Data