Copying Functions › Function Templates › Creating a Template Function
Creating a Template Function
This process applies both to the primary template function and to any functions the primary function references that also to serve as template functions.
- There are two ways to create a template function:
- Go to the Edit Functions panel for the *Template file and create a new function.
- Go to the Edit Functions panel for a model file and copy an existing function to the *Template file. This is best if you already have customized functions that can serve as templates.
- Adjust or create the function as you would any other function:
- Name the function. When naming a template function you can place *Template in the name where you want the target file name to appear; for example, Work with *Template data translates to Work with Customer data for the Customer file.
- If the function requires an access path, specify an appropriate one based on the *Template file.
- Add standardized actions to the action diagram.
- Specify parameters for internally-referenced template functions using the following two fields defined for the *Template file:
- *Template key defn—If this field is a parameter on a referenced function, it is replaced by the target file’s key fields.
- *Template record defn—If this field is a parameter on a referenced function, it is replaced by the target file’s non-key fields.
Note: In both cases all fields are used.
- Save the template function.