I love a nerdy title and I love learning about cool new smart stuff.
But before you continue reading I want to say thanks to my colleagues at ForNAV, especially Michael Nielsen. Without him pushing me (again) to step out of my comfort zone this would not have been possible.
Yesterday I visited the Microsoft office in Lyngby for the first time in a very, very long time to talk about our project to split up the base app. We also talked about something else, but that will be another blog. (Soon…).
The biggest showstopper we had in the old days with C/Side to separate code was the option field. Option fields are often where modules get together and programmers make switches in the code about which business logic to execute.
This is fixed now with the enum, and it will be even better in the next spring release with the interface implementations.
But before you can execute on that you have to change the Option field into an Enum. And yes, this means changing a field type.
Changing field types is not allowed in AL when you run on AppSource. You have to obsolete the field and introduce a new field.
You can imagine that this makes implementing this feature incredibly complex right?
The day before yesterday’s meeting however I sat down with Michael at our office in Horsholm to see if we needed to make changes to the ForNAV product in order to implement Enum support.
Imagine how surprised we were when we noticed that the FieldType::Enum did not exist.
And we did some testing and it looked as if an Enum field returns FieldType::Option.
I tweeted to #BCAlHelp and got no logical answer.
So I decided to save this question for my meeting with Microsoft, also because one of our team members, Cristina Nicolàs identified the schema change as a project risk.
At Microsoft I was happy to learn that this is all by design. Someone smart at Microsoft must have realised that since at SQL Server level this is always an Integer anyway it would only make sense to allow this flipping without making a breaking change.
Off course I had to test this in order to blog about it.
I have created a simple table with an option field and published this to a Sandbox.
Next I change it to this
And yes, I can publish this without getting errors.
Enums will come in next Spring Release!
All of the teams in our project of splitting up the base app implemented their own Enum’s because last Fall release was shipped without it.
We were happily surprised to hear that Microsoft has implemented the Enum in the usual suspected places and they are expected in the next Spring release.
I’ve been told, but I did not yet have time to confirm this, that the Insider Docker build already as this code. The compiler of this Docker image also allows you to play around with Interface objects.
Again, thanks to everyone to make this possible and transparent. Thanks to the Base App split team and thanks to Jesper and Bugsy at Microsoft,