Thank you for being a valued client of CM First Group. If you have any technical issues or concerns, please open a ticket on support.cmfirstgroup.com, email CM First technical support at support@cmfirstgroup.com or call us on our 24/7 customer hotline at +1 (512) 623-7586.

Follow

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.

Plex

For this example we will use the entity OrderDetail.

The inheritance would be defined like this:

OrderProcessing.OrderDetail is a ENT Ability.ListTotals.

After inheriting from ListTotals observer that the entity OrderDetail has a new view named Total Attributes.

In the Total Attribute view choose a field(s) found on the grid to calculate its total. In this example we will use two fields from the grid: Quantity and Derived Line Total.

Generate Changes.

For the test Model there is an OrderProcessingbuildObjects list object that contains all the template generation functions for all the entities of the application:

After generating the OrderProcessingbuildObjects list generate the ApplicationServerObject which is a list of all the server objects required for the HSYNC application:

back to top

Eclipse

Now go to eclipse.

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

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:

back to top

Test Changes

Observe that the calculated fields are correctly displayed with the right amounts

back to top

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk