Hi everyone. This might seem like a very basic question but I just had a query. Till AX 2012 we preferred to write code at class level and tried to put as little code as possible at the form level. Reason being, the form ran at the client. Does that rule still hold in D365 ? I mean, has there been any major architectural changes regarding the client and server position ?
You’re right, all X++ code now runs on web server, therefore the client-server optimization isn’t relevant anymore. (There is still code running on client in browser, but it’s JavaScript of UI controls, not X++).
Nevertheless logically separating UI logic and core business logic is still as relevant as ever. Code that may be useful from other places (e.g. other forms) should be in classes or tables, not in forms. Splitting code to classes with clearly defined responsibilities makes maintenance and extensibility easier. It’s also better for unit testing.
But putting UI logic specific to the given form directly on the form is fine, as it used to be.
Thanks so much Martin. This really clarifies the concept.