How to define multiselect fields

Our client needs several product fields that are both filters and multiselect. I have defined them in ProductFieldDefinitionSetup.cs:

            new FieldDefinition<ProductArea>("NewField", SystemFieldTypeConstants.TextOption)
            {
                CanBeGridColumn = true,
                CanBeGridFilter = true,
                Option = new TextOption
                {
                    MultiSelect = true,
                    Items = new List<TextOption.Item>
                    {

                    }
                }
            },

as you can see I have skipped defining the Options, added them in back office and this actually works. However, do I need to define this field anywhere else (ProductItemViewModel.cs and ProductItemViewModelBuilder.cs for example)?

Litium version: 7

Do you add it to a ProductFieldTemplate manually in BO?

Yes exactly, cus we don’t know all possible options yet.

If you need to show the value from the field (visible on site) then you need to implement it of course everywhere it is required.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.