Aras Innovator prides itself on being a flexible platform that can be easily customized to fit any of your business needs. Today we'll be covering some general best practices to keep in mind as you begin your journey of customizing Aras Innovator.
Make Changes to the Database (Not the Codetree)
When we want to extend and change how our users interact with Aras Innovator, there are two main ways we can go about it. Let's consider a simple example where we want to add a button to the toolbar of an item's form.
The first way, and in much earlier versions of the only way, is to navigate to wherever we have installed Aras Innovator (we refer to this as the codetree) on our server and make changes directly to the source files that control how item forms are rendered. Making changes this way offers the most flexibility in terms of fine-tuning exactly how you want the UI to look, but it comes with pretty substantial downsides.
- It introduces potential caching issues for users who have an older version of the file cached locally
- Pin-pointing exactly which file needs to be modified is difficult
- Migrating the changes to other instances (like a development or production server) is more cumbersome
- Upgrading to a newer version of is more time-consuming as codetree files are the most likely to change between versions
Instead, it's better to take the second approach whenever possible, and make changes directly inside the database. For our example of wanting to add a new button to the toolbar, we can easily accomplish this in most versions of Aras Innovator 11.0 and every version of Aras Innovator 12.0 by using the Configurable User Interface (CUI). Item toolbars aren't the only place where you can easily add or remove UI elements. Since it's introduction in Aras Innovator 11.0 SP7, many areas of the UI are now rendered and thus are configurable through the CUI data model. If you're interested in customizing your Aras Innovator user interface, we have many blogs that cover CUI and how to make changes to specific areas.
When CUI Won't Cut It
CUI is very powerful in what it allows us to change, but it is also limited to only those areas that are currently supported. Let's say we have an ItemType that we want users to edit by using a completely custom user interface that looks nothing like a standard Aras form. Even in cases like this, it may still be possible to make your changes only to the database.
Besides creating a a new ItemType, writing a new Method is one of the first pieces of customization that most people will make to their Aras Innovator instance. These custom Methods will obviously be stored in the database, but there are some additional best practices to keep in mind.
Keep Methods Small
The easiest thing to implement when we start developing is to enforce some soft limit on how many lines of code we want our Methods to be. Developers have different personal thresholds that are anywhere from 15-50 lines of code, but the main thing we're trying to avoid is one very bloated Method that controls everything. While it's easy to enforce a code limit at the start, it's very difficult to go back and break up a single Method that is thousands of lines long.
Use Server Methods Where Possible
The sample code below demonstrates how to display a spinner to the user for calls that we expect might have a long run time.
Using this approach, the user will see a spinner for as long as the server call takes to run. This will still prevent our user from doing additional work, but they will at least have visual confirmation that the UI hasn't just hung on them. If we expect our call might take an extremely long time, we could rewrite our code to remove the await call and to maybe throw up a confirmation dialog after the server call returns. This would not lock the UI, so our user would be able to continue performing work while our long-running request runs completely in the background.
Developing for Aras Innovator requires some domain-specific knowledge, but many software development best practices can still be applied to improve the overall performance, maintainability, and usability of the platform. As with any development best practices, the best time to start thinking about them is before any code has been written or customizations have been made. Please comment below with any best practices or design guides you use for your Aras Innovator instance.