back to top

Using Client-Side Calculations on Pages in Creatio (formerly bpm’online)

There are times in Creatio you’ll need to do calculations on a page. To do this it is pretty simple but it does involve a little bit of JavaScript. In this article I will cover a scenario where a page has a total amount that a customer owes. The user will enter a percentage amount for how much of a deposit the customer owes now. Our code will do a calculation to figure out the deposit amount and the amount remaining.

Ryan has written up the steps for wiring up a change event, so we’ll be referring to those steps in this article.

For our scenario we have the following fields.

In my scenario the dollar amount is the total amount the customer owes, the percentage is a value the user enters for the deposit percentage for what the customer must pay now. The last two fields is where I will put my results of the calculation. My code will determine the amount of the deposit and the remaining balance. Here are the steps for putting this together.

First step to do is add an attribute to wire up the change. With this attribute we’ll create a method to be called when the columns change.

 attributes: { 
	"PaymentCalculation": {
		dependencies: [{
			columns: ["UsrDollarAmount", "UsrPercentDeposit"],
			methodName: "onPaymentCalculation"
		}]
	}
}, 

I want the calculation to trigger every time there is a change in the dollar amount or a change in the percentage amount. In the columns of my attribute I have both of these fields and every time either of the fields change it will call the method. This is what my method looks like.

 methods: {
	onPaymentCalculation: function() {
		var percent = this.get("UsrPercentDeposit") || 0;
		var amount = this.get("UsrDollarAmount") || 0;
		
		var deposit = amount * (percent / 100);
		var remaining = amount - deposit;
		
		this.set("UsrDepositAmount", deposit);
		this.set("UsrRemainingAmount", remaining);
	}
}, 

In this function we first have to get values for our fields, then do the calculations, and put our results into the fields for deposit and remaining amount. My example was to calculate a deposit but the same steps can apply for any calculation.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author

LEAVE A REPLY

Please enter your comment!
Please enter your name here

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Using the AI Prompt to Create Dynamic Folders in Creatio

Using Creatio's AI prompt to create the filter for a dynamic folder works best if you specifically ask for that, and if you are as clear and direct as possible about the filtering, conditions.

Related Articles

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Related Videos