back to top

Opening an Edit Page to Add or Edit a Record from Client Code in Creatio (formerly bpm’online)

If you need to open an edit page programmatically to add or edit a record in bpm’online, this can be easily done using the built-in openCardInChain method. This allows you to specify an edit page and indicate if you want to add a new record, or edit an exiting one. If you’re adding a record, you can supply default values for the new record. If you’re editing a record, you can supply the ID of the record you want to open in edit mode.

This allows you to do things like programmatically open the add activity screen to add a new task and automatically relate it to the record the user is on. Or, programmatically open an address record in edit mode. Or, to open the add screen for a detail programmatically based on some condition that has happened on the screen.

To edit an existing record, we will open the edit page like this. In this example, we are passing the ID of the record we want to edit as theIdToEdit variable in the code:

this.openCardInChain({
    schemaName: "UsrMyPage",
    operation: ConfigurationEnums.CardStateV2.EDIT,
    id: theIdToEdit,
    moduleId: this.sandbox.id + "_UsrMyPage"
});

You’ll also need to add ConfigurationEnums to the modules list. This means you’ll add ConifurationEnums to the module/page you’re using this code above from:

define("UsrMyCurrentPageV2", ["ConfigurationEnums"], function(ConfigurationEnums) {
 
    //....
 
});

To add a new record, we can open our edit page in add mode. We can also (optionally) supply default values for our new record. So, if our edit page has a lookup to Case (property name UsrCase), we can default the selected case by passing the case in the default values. Since this is a lookup, we need to provide the case ID and the display value, the case number. For a simple example, we’ll also default a string property on the edit page named UsrTextField to a value as well. The code would look like this:

this.openCardInChain({
    schemaName: "UsrMyPage",
    operation: ConfigurationEnums.CardStateV2.ADD,
    id: this.Terrasoft.GUID_EMPTY,
    defaultValues: [ // include default values if wanted
        {
            name: "UsrCase",
            value: myCaseId,
            displayValue: myCaseNumberText
        },
        {
            name: "UsrTextField",
            value: "This is default text"
        }
    ],
    moduleId: this.sandbox.id + "_UsrMyPage"
});

The page will open in add mode, with the default values filled in.

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

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