Building the Form
Start with the form. We need a fresh form, and we need that form to have at least one field we can work with. For information on how to open a form from wherever you need, take a look at Opening A Custom Dialog from a Method.
- From the Table of Contents>Administration>Forms, go ahead and create a new Form.
- In the Name field, type “Summary” and hit the Save button.
- In the Form Editor below, create a new HTML field.
- Select the new field from the Fields list.
- Click the Field Label tab
- Erase anything in the Label. We’ll make our own labels later.
- Click the Field Type tab.
Now we’re getting somewhere. See that HTML Code box? As long as you put valid HTML in that box, you can make use of your existing web development skills. Of course, this is a best practices article, and you’ll soon find that this small box is not an ideal development environment. While you could work in the editor of your choice and then copy and paste code into the field HTML Code box, Aras Innovator already has a better way.
- Click the Form Event tab
- Create a new Method
- Give it a name- for this example, we’ll call it “SummaryCreator”
- In the Execution_Allowed_To column, set this as needed. In our example, we’ll use the World identity.
- For the Event, make sure to select onLoad. We want this event to fire as soon as we navigate here.
- Give it an early Sort Order. For example, we’re using 10.
- Save the Form.
When we saved the form, Aras Innovator created our method for us. We can right click our method in the Form Events and select Open to get right to work!
One neat trick- Methods are versioned, meaning each time you hit Done here, you'll create a new version you can later go back to or refer to. We like to make committing easy!
Writing the Method
In this Method, remember that you have access to everything on the Document Object Model. This means that code like the following should result in the age-old Hello World display.
From here, a web developer can begin using the tools they’re familiar with to manipulate the display, run client-side code, and even make use of external libraries via referencing the library in an url. If you passed in an Aras object to your form, then you also have the powerful Aras IOM here. You also have some versioning courtesy of the Aras Innovator Method editor, and changes you make will show up in your form without needing to refresh your window.
Conclusions and Congratulations