Working with Transaction Extension in XtendM3
- Use cases
- Step by step implementation
- Important notes
- Exported Extension
- See Also
Transaction extension is a type of extension where one could create a custom M3 API (MI) Transaction. These custom transactions will behave identically to standard M3 transactions i.e. they have input/output parameters in the same structure as standard APIs and they can be executed through both ION API and M3 Metadata Publisher.
- Reading input and writing output data
- Retrieving or changing transaction parameters
- Writing error messages and skipping transactions
- Building and setting data containers
After opening M3 main page, select Menu on the top left corner. Then select XtendM3 from Administration Tools folder.
To create a new extension select “Create a new extension” button.
Opened window displays an option to select the type of extension to be designed. Select “Transaction” and then click “Next”.
Fill in extension information as described:
- Program : Name of an existing or new program where the extension will be created
- Name: Name of the extension
- Description: Functionality of the extension
- Multi (option): Multi option allows to return multiple records to the user. Otherwise will return a single record. Multi can be used to list APIs.
Then click “Next”.
At this point you can create fields with input or output data by clicking a plus button and filling in the information:
- Name: 4 uppercase character name of the field
- Type: text/ number (select “number” for inserting date field)
- Lenght: maximum input lenght
- Mandatory (option): choose if the input will be mandatory (only for input fields)
- Description: more detailed description of the field
Click “Save” to finish.
Created extension will contain default code template.
Over the code field there are several tools with which you can operate on the designed extension.
Listing them from the left side they are used to:
- Enable editing mode
- Export the code
- Extra settings to change the parameters of the extension or enable it etc.
- Delete the extension
- Information about the extension
- Test compile
To start writting extension code enable editing by clicking “Edit” button.
To finish save written extension by clicking “Save” button. It is necesary to activate the extension from settings as shown below for it to be exectuted.
- Always test the examples for your own solution before using them in production
- Do not use transaction API in Transaction extensions
- It is a good practice to use a test compilation of the program before running
- Data presented in the examples is random