Connection and the IOM

Connection and the IOM

While Aras Innovator strives to be a low code environment where you don’t need developers to get the job done, sometimes your developers want to use their skills on your Aras Innovator instance. It’s true that to a programmer’s mind, the most direct solution sometimes feels like using the tools they already know. While you can write methods within Aras Innovator’s method form, you can also write your own tools that use the Innovator Object Model to do just about anything you could do in the user interface.

The following assumes a working knowledge of C#, as well as AML. We’ll be using Microsoft Visual Studio as our development environment, but you should be able to follow along wherever you write your code.

Get the Reference

First up, we need one very important reference. The Innovator Object Model (IOM for short) is a vital part of working with Aras Innovator in code. If you’re writing in the Method editor in Aras Innovator, then you don’t need to explicitly reference the IOM, but out here we’re short that convenience. Open up your project, and add a reference to the IOM.dll. You can find it in the CD image you installed Aras Innovator from, under Utilities in a zipped folder for the IOM SDK.

Now that you have the IOM.dll, most development environments will start giving you autocomplete features and helpful information on functions or inputs. Still, exactly what kind of feedback you get will depend on what tools you're using. What we do know is that now you'll be able to use the IOM to write some code!

Write Some Code

Now lets write some basic setup code. You need to include the IOM, and then in Labs the next step is to make sure we can connect. In the following example we’ve hard coded our login information, but you can freely replace this with whatever text entry is most convenient for you. Some of this might remain hardcoded depending on your needs- a dedicated application for your organization might always use the same url and database, after all.

The three important lines are creating the server connection, logging in, and then getting our inn object. The first two are vital, opening up the path of communication between your application and your Aras Innovator instance. The third is more of a convenience, but if you’ve seen any Aras Labs code before, you’ll know it’s a convenience we’re very fond of!

Now that we’re connected, what can we do with this? In other words, what was the point of all that? Well, we can do all the things we’re used to doing on server side methods, but now we do them from whatever custom application you’re building! While single quick queries can be accomplished with .applyAML, more complicated structures should probably be built out with use of the IOM.

From this point on, all your experience writing server code should serve you well. If you want to learn more about server side coding with Aras Innovator (or you just need a refresher!) then we have some previous articles that might be helpful for you.

Conclusions and Congratulations

No code, low code, or all code, Aras Innovator is ready to help you make your own solutions. Today you’ve learned that you can take your favorite features from the Innovator Object Model into whatever development environment you prefer, even to the extent of building out your own interface or building your own administration tools. Let us know in the comments below what kind of environment you use the IOM in, and what could make your work easier!