Hello, I’m trying to prepopulate a custom product field, its really just a string array, But I can’t get it to work.
The normal TextOptions works fine, but not my custom class:
is there a collection I can use? that already implements Litium.ComponentModel.IReadOnly and make this possible? Or do I need to use the TextOption class/Create a custom class?
IReadOnlyCollection<FieldData> options = getOptions();
var clone = fieldDefinition.MakeWritableClone();
clone.Option = options;
using (_securityContextService.ActAsSystem())
{
_fieldDefinitionService.Update(clone);
}
Error:
Litium.Validations.ValidationException: 'Validation error for FieldDefinition(SystemId: e40b95a4-c6a1-4ef7-2478-08d65529a601, Id: Ingredients), Option: 'The 'System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib' need to implement Litium.ComponentModel.IReadOnly.'.'
Litium version: 7