Liberty Create How To

Liberty Create – Mathematical Calculation and Validation using Fragment Callback and Fragment Validators

There is no direct way in Liberty Create Build Studio where we can perform a calculation and validation using multiple fields on client side, and show total or compare values between fields as we change any of the field values on form.

However, we have a solution! This can be achieved using the Code Studio – Fragment Callback and Fragment Validator.

This article will cover the steps on how to add and make use of Liberty Create Fragment callback to perform calculation and Fragment Validator to compare field values.

Step 1

  1. Create a page with multiple decimal fields and mark Total(Calculated) as read-only using CSS (this will be calculated automatically).

ynergy Blog Netcall Liberty Create - February 2020 - Step 1 image

  1. So, in the above screen, we are going to perform two operations:
  • Calculation – Total (Calculated) = Consulting + Accommodation +Flight + Transportation +Tools + ((Consulting + Accommodation +Flight + Transportation +Tools) * Extra Share %age)
  • Validation – Expense Limit > = Total (Calculate)

 

  1. In order to perform (calculation), we will be using Fragment Callback as we have to perform calculation as soon as any of the field value (Consulting, Accommodation, Flight, Transporation,Tools,Extra Share) changes.
  2. For (Vaidation), we will be using Fragment Validators.

 

Step 2

  1. Let’s create field path references to point to the fields required for calculation.

 

  1. Click on References from Code Studio and Add Reference.

ynergy Blog Netcall Liberty Create - February 2020 - Step 1 image

 

 

  1. Create reference for each of required fields for calculation (Consulting,Accomodation,Flight,Transportation,Tools, Extra Share,Expense Limit and Total Expense Amount).

Synergy Blog Netcall Liberty Create - February 2020 - Step 2.1 image

Synergy Blog Netcall Liberty Create - February 2020 - Step 2.2 image

 

 

Step 3

 

Create Fragment Callback to Calculate the Total Expense Amount:

 

Select Fragment Callbacks under processors and click on Add New.

 

ynergy Blog Netcall Liberty Create - February 2020 - Step 3

 

 

Enter Name and Click Create . Click on Code

 

Synergy Blog Netcall Liberty Create - February 2020 - Step 3.1 image


Registration is required to view the full article.

Synergy benefits



Please login or register to access the full article.

You may also like

Please complete the below form and a member of the Velocity IT team will call you back.



INSTANT ESTIMATE