wherecontains not returning the value

Certified Associate Developer

Hi Team,

I have a dropdown field in which once user selects the value, based on it the grid below displays the result. 

a!dropdownField(
label: "",
labelPosition: "",
placeholder: "Years Available",
choiceLabels: local!years,
choiceValues: local!years,
value: local!selectedYear,
saveInto: {
local!selectedYear,
a!save(ri!selectedYear, local!selectedYear),
a!save(local!GridData,
wherecontains(tointeger(local!selectedYear),
tointeger(index(ri!engagement,"clientYearEnd",null())))
),
a!save(local!selectedIndex, null),
a!save(ri!selectedEngagements, null),
a!save(local!data, null)
}
)

The local!GridData is used in the data parameter of the gridField but here it is not getting any value. Can anyone please suggest what needs to be done?

Thanks

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to ananditab0003

    What is the expected value of local!GridData prior to a value being selected from the dropdown?  Would it contain all values in ri!engatement, or just be empty?

    As Stefan already noted, the result of the whereContains() function simply returns a list of indices.  If you want to use that to actually pull data from those indices in an exisitng list, you can pair this with the index() function.  I would still suggest doing this within the declaration of local!GridData instead of manually setting it in a SaveInto of a dropdown, though. 

    If you could post a small sample of example code, something which any of us could copy and paste into a blank interface editor without needing your specific CDTs or Rule Inputs, we'd be able to help a lot more easily.  If you do, please utilize the "Code Box" functionality: Insert --> Insert Code in the comment menu.