Field type changing
Hello,
Do you support an availability of changing a field type? If yes, I've found a little bug: When I try to change the field type from "Text" to "Note" if fails with an exception:
field or property "NumberOfLines" doesn't exist
It looks like SPMeta2 tries to set a property "NumberOfLines" on "Text" type field and fails because of such property doesn't exist. This property is only actual for "Note" field type. So SPMeta2 should change field type from "Text" to "Note", and then set properties.
I use SharePoint 2016 On-Premises, CSOM, and SPMeta2.CSOM.Foundation v1.2.130
Field definition:
public static NoteFieldDefinition Coordinates()
{
return new NoteFieldDefinition
{
Id = new Guid("7d021794-f805-4a5f-ad10-95892b68a522"),
Title = "Coordinates",
InternalName = "Coordinates",
Group = ".Test",
AddFieldOptions = BuiltInAddFieldOptions.AddToAllContentTypes,
EnforceUniqueValues = false,
NumberOfLines= 6
};
}
No, unfortunately changing field types isn't supported right now.
There are a few tickets related to this:
- https://github.com/SubPointSolutions/spmeta2/issues/1083
- https://github.com/SubPointSolutions/spmeta2/issues/720
In a nutshell, it's a complex operation from both implementation and testing. Plus it might turn out in a data loss or corruption.
On a radar, might happen in a few month from now depending on the current workload.
Oh, I see. It will be good. Thank you for so fast reply!
Not a worry. We might do that mid-November.