To return Complex Types are usefull, too, but at the moment they are very cost intensive since they result in a copy of a Record.
Related Improvements for the System Applications (and there might more cool possibilities)
https://github.com/microsoft/ALAppExtensions/pull/9874
https://github.com/microsoft/ALAppExtensions/pull/12281
This is only one scenario as example, but I could imagine more since the support of "var variant" would give use many possibilites to write more flexible code.
Comments
...and that phrasing of it was already filed here: https://experience.dynamics.com/ideas/idea/?ideaid=08a6c1b1-2583-eb11-8ced-0003ff45ceba
Category: Development
`var Variant` parameters are supported fine. I guess what you really mean is automatic un/boxing between any other arbitrary type and a `var Variant` parameter, where the compiler would handle assigning the source object to the Variant on entry to the function, and back again on exit. That might be quite complicated to provide as a feature of the language, hence why it's currently left to us developers to do it manually. It'd be nice if it could be solved in a tidy, non-risky or non-breaking way, but I don't know whether that's possible.
Category: Development
Business Central Team (administrator)
https://experience.dynamics.com/ideas/idea/?ideaid=08a6c1b1-2583-eb11-8ced-0003ff45ceba