Skip to main content
February 26, 2021
Solved

Multi Drop down error in grid ?

  • February 26, 2021
  • 2 replies
  • 0 views

Hello everyone,

Facing issue to display multi dropdown in editable grid. I want to display the interface having editable grid in record.

rows: a!forEach(
items: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
expression: a!gridRowLayout(
id: fv!index,
contents: {
a!textField(
label: "Description " & fv!index,
value: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
saveInto: fv!item.description
),
a!dropdownField(
label: "Category " & fv!index,
placeholder: "--- Select ---",
choiceLabels: { "Office Supplies", "Personal", "Other" },
choiceValues: { "Office Supplies", "Personal", "Other" },
value: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
saveInto: fv!item.category
),
a!integerField(
label: "Qty " & fv!index,
value: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
saveInto: fv!item.qty
),
a!integerField(
label: "Unit Price " & fv!index,
value: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
saveInto: fv!item.unitPrice
),
a!integerField(
label: "Amount " & fv!index,
value: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
saveInto: fv!item.amount
),
a!richTextDisplayField(
value: a!richTextIcon(
icon: "close",
altText: "delete " & fv!index,
caption: "Remove " & fv!item.description & " " & fv!item.category,
link: a!dynamicLink(
value: fv!index,
saveInto: {
a!save(
ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
remove(
ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items'],
save!value
)
)
}
),

the above code throwing error in record

Best answer by marco.amador

Hi,

It looks like the value you are displaying (from your record) does not match one of the possible choiceValues.

This seems to be because what you have under 'value' is the entire set of record fields inside 'items', while what you want to display is actually PurchaseDetails.items.Category, for instance.

At the end of this...

value: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items']

you should add yet another '.fields.' and then select the desired item field. 

2 replies

marco.amador
March 1, 2021

Hi,

It looks like the value you are displaying (from your record) does not match one of the possible choiceValues.

This seems to be because what you have under 'value' is the entire set of record fields inside 'items', while what you want to display is actually PurchaseDetails.items.Category, for instance.

At the end of this...

value: ri!purchaseDetails['recordType!{42faad32-9822-4aa3-903a-13045e657d3b}PMT Purchase Details.fields.{items}items']

you should add yet another '.fields.' and then select the desired item field. 

March 2, 2021

Thanks [mention:6cc8c9d66788472781d838df94d22741:e9ed411860ed4f2ba0265705b8793d05] , the above code is working fine.