back to top

Updating a Record from Client-Side Code using UpdateQuery in Creatio (formerly bpm’online)

In my previous article, I covered how to insert a record from client-side code using InsertQuery. In this article we’ll cover how to update data from client-side code using the UpdateQuery object.

The UpdateQuery looks pretty much the same as the code for the InsertQuery, we’ll create the object and specify the rootSchemaName (the object we’re updating), add the column values we’re updating and execute. However, for an update, we’ll also need to provide a filter (just like with EntitySchemaQuery) that indicates the record, or records, to update. Note, an UpdateQuery can update a single record, or multiple all at once, this all depends on the filters you provide to the UpdateQuery. In this example, we’ll assume we have an object named UsrWidget, that is related to Account, we’re going to set the quantity of all items on the account as the value 10. Let’s look at the code:

var update = Ext.create("Terrasoft.UpdateQuery", { rootSchemaName: "UsrWidget" });
update.filters.add("AccountFilter", 
  update.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "UsrAccount", this.get("Id"))
);
update.setParameterValue("UsrQuantity", 10, Terrasoft.DataValueType.INTEGER);
update.execute();

Note, we just create the UpdateQuery, add the filter (in this case, all Widget’s related to the current account), then set the columns we want to update (in this case, just setting the quantity of all records to 10), then we execute. When we add the columns to update, we need to indicate the data type of the column value. As I mentioned in the article about InsertQuery, you can see all of the possible values in the documentation, or you can open up your browser’s DevTools on a Creatio page (any page) and type “Terrasoft.DataValueType” in the console and hit enter and you’ll see the list of available types.

Just as with InsertQuery, when we execute the update we can add a callback to occur after the update is complete, like this:

update.execute(function() {
    // do something here
}, this);

or this:

update.execute(this.myCallbackFunction, this);

Next, we’ll cover how to do client-side deletes.

As always, you should always consider where the best place is to perform an operation like this. Keep in mind, doing this from the page code means that the logic won’t happen for imports or things that might trigger from other server events since it only exists on the page.

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
Ryan Farley
Ryan Farleyhttps://customerfx.com/article/author/ryanfarley/
Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Embedding a Creatio Chat Widget on your Website in Less than 5 Minutes

Creatio version 10X has an out of the box...

Query the Creatio Database to Locate Source Code or Client Schemas Containing a Value

Often when working with Creatio, I need to locate...

Building AI-Powered Workflows in Creatio Without Writing Code

See how Creatio can combine AI with no-code business processes to qualify, summarize, and route incoming leads while keeping your existing business rules and human oversight in place.

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.

Related Articles

Embedding a Creatio Chat Widget on your Website in Less than 5 Minutes

Creatio version 10X has an out of the box feature that allows you to easily embed a Chat...

Query the Creatio Database to Locate Source Code or Client Schemas Containing a Value

Often when working with Creatio, I need to locate code or client schemas based on their content, not...

Building AI-Powered Workflows in Creatio Without Writing Code

See how Creatio can combine AI with no-code business processes to qualify, summarize, and route incoming leads while keeping your existing business rules and human oversight in place.

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.

Related Videos