top of page

Moji5 Knowledgebase

Table Column Summation

Updated: Nov 25, 2021

Function to calculate summation from a table column.


How to Calculate Table Column Summation


1) Method 1: M5 Function


Create a new behavior. Put the appropriate caption. Click Action wizard.


Click Create an action.


Click Table Column Summation.


Select as per below setting. Click OK.


Click Save changes.


Click View code. Leave it as it is. Check syntax, if no error then click Save and close.


Click Create now.


How it look in the form:


Add your record into table Purchase, M5 will calculate the total of Price from the Purchase table.


2) Method 2: Javascript Function


M5 introduced new method to sum up amount by using javascript.


In Form design & layout page, allow in-row editing by select 'Yes'. Choose either Popup or Inline. In this example, choose Inline.













Click Edit Detail Form on your 'Purchase' table.


Since we want to sum up the price, so click Advanced settings on 'Price' field.


Click New attribute.


Write as per below code.


Click Save changes.


Click Save changes.


How it look in the form:


M5 automatically sum up the Price once you added the item.


Comments


bottom of page