Provide a Method to Calculate Values for Derived Attributes

Provide a Method to Calculate Values for Derived Attributes


Plex

This example will use the entity OrderDetail where a derived field will be added. Enter the following triple:

OrderProcessing.OrderDetail has a derived FLD LineTotal.


Generate Changes.

On the test Model there is an OrderProcessingbuildObjects list object that contains all the template generation functions for all the entities in the application.


After generating the OrderProcessingbuildObjects list we need to generate ApplicationServerObject that contains all the server objects of the application:


Eclipse

Now go to eclipse.

To import all the generated function right click and refresh the java project:


Then look for Custom Derived Calculations.inc. Add code for the derived field:


Then run the Application Generator:


When the application is running do the following:

  1. Click on Application Settings then on Apply:

  2. Click on Application Template, select Gen Folder, and Generate Application. Wait for the message that all was generated successfully.

Now right click and refresh the web project.


Run tomcat server.


Test Changes

See that Line Total is a derived attribute and is calculated. The calculation of line total is Quantity x Product Price.



    • Related Articles

    • How to add items with dual values on a combo box

      This tutorial show you how to create an item on a combo box that implements two values, one will be the key value of the item and the other would be the description of the item. You can achieve this by creating a custom API function to add the items ...
    • How to solve the Invalid method Code length issue?

      This issues is b/c  the Java code Hit Java limit, which human is impossible to hit but generator hits, this is Java limitation that does not exist in RPG, here is the information you will need in order to solve the issue in the specific functions but ...
    • Totals Calculation

      To implement this feature it is necessary to inherit from the ability to List Totals, which is done via the triple: MyEntity is a Ability.ListTotals. This will inherit a view 'TotalAttributes' which will be added any field(s) that need to be totaled. ...
    • Resizable Panels Using Fixed Positioning

      Introduction WebClient includes a feature called FixedPositioning that can be used to make panel functions auto resizable according to the user’s screen. This works by using the values of Fix, Size and Position properties of each control in the ...
    • CM evolveIT ETL - Create a new Source File Info

      1. How to create a new source file info New project >> Source Files >> Add >> Source Files Assignment dialog >> Add Menu >> Source File Info >> "+" button 2. Add Source File Information 2.1. Type - Git Fill in fields with valid values, if the ...