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

By Kilian Hekhuis on 24 Jun 2015
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.
J.24 Jun 2015
wouldn't it better to fix the extensions?

Justin James25 Jun 2015
Extensions get no love. :(

Kilian Hekhuis25 Jun 2015
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.