Conversion from structure/entity type to structure/entity type Record

On our radar
There's quite a number of extensions that have as input a generic Record (passed as Object), e.g. AutoEntityDiff, XMLRecords, ardoJSON etc. Since version 9 of the platform, the preferred way for structures and entities is to have variables or parameters of them as type, instead of type Record. However, you can't pass such a variable to said extensions, as they won't understand the internal structure (not an IRecord), and will fail or crash (I just solved a "Object reference not set to an instance of an object."

Given the above, it would be ideal to have a Built-In Function for converting such a variable to a record of its type, so you can pass it to an ToObject() and into the extension, saving you an extra variable and assignment.
Created on 24 Jun 2015
Comments (3)
wouldn't it better to fix the extensions?

Extensions get no love. :(

Now we have J. and J.Ja :). Anyway, J., no, fixing the extensions is not an option, imho. The new types are afaik completely undocumented, and as far as I've seen more complex then the old IRecord ones. It would take quite some effort to reverse engineer them, and even more effort to make the extensions compatible with both the old IRecords and the new types, let alone e.g. compare them like the AutoEntityDiff extension does. Since the platform already can convert between the new types and Records of a type, having a built-in conversion function would be relatively trivial to implement.