that is really weird. I get the same error when setting the configuration in the way you describe.
I tried a couple of things and when I saved the DataType first (without the configuration) and set the configuration afterward (with the same values), the configuration is being set correctly. (below ugly/verbose code used for testing purposes)
var config = new BlockListConfiguration{...}
_dataTypeService.Save(newDataType);
var testType = _dataTypeService.GetDataType(name);
testType.Configuration = config;
_dataTypeService.Save(testType);
I hope someone else has some good insights on why it does not work when constructing it from scratch.
Creating a Block List Data Type Programmatically
I am getting an error when trying to create a block list data type programmatically.
The issue is when I am trying to set the configuration.
Please can you help me work out where I am going wrong?
Here is my code:
Kind regards
Paul
Hi Paul,
that is really weird. I get the same error when setting the configuration in the way you describe.
I tried a couple of things and when I saved the DataType first (without the configuration) and set the configuration afterward (with the same values), the configuration is being set correctly. (below ugly/verbose code used for testing purposes)
I hope someone else has some good insights on why it does not work when constructing it from scratch.
Hi
I got it working. My friends Anders and Callum helped me in the MVP slack group.
I’ll update this post later with the solution.
Thanks
Paul
is working on a reply...