A template can be created for almost any code. Templates are generally created whenever you have a commonly used section of code or logic. Again, templates do not have to generate complete functions. They can create any standard block of code.
When using templates, you can follow five simple steps:
1. Review List of Templates
When creating a new function, you should first review the existing templates to see if you can use or modify the RDML they already provide.
2. Read Help Text
Each template comes with online help panels which explain what the template will produce and how you should answer the template questions.
3. Select Template
Once you have found a template which meets your needs, you can execute it when creating a function or when editing the LANSA object.
4. Execute Template
As you will notice in the help text documentation, templates support the use of the cancel key to move backwards through the interactive screens.
5. Compile & Test
Once the template has completed execution, the RDML commands will have been inserted into the LANSA object. This RDML can be modified or compiled as is (if a complete program was generated), and then tested.
It is strongly recommend that you review all the templates shipped with LANSA. You should copy and then modify the templates to meet your site standards.