back to top

Generically Retrieving Schema Information About the Current Creatio Freedom UI Page

If you have the need to discover information about the current page in a generic manner, for cases where you might have a custom base page type that could be used for several different entity objects, the following will help you determine the schema information about the current page’s primary data source.

Getting the Page’s Primary Data Source

The first step in getting the bound schema/object information for the current page is to first get it’s primary data source. The primary data source will allow us to dig deeper to get the object information for that data source. On many out of the box pages, the primary data source is named PDS, but it could, and often is, named anything (especially on custom pages). You can get the primary data source using the function below:

const pds = await request.$context.getPrimaryModelName();

Getting the Schema Information for the Data Source

With the data source name, you can now get the schema information for the datasource which will give you the entity/object name, the Id column attribute, and also the primary display value attribute using the following (note, this gets the attribute names, not the values):

const pds = await request.$context.getPrimaryModelName();
const schema = await request.$context.dataSchemas[pds];
 
const entityName = await schema.name;
const idColumn = await schema.primaryAttributeName;
const nameColumn = await schema.primaryDisplayAttributeName;

The code above will retrieve the primary data source for the page, then use that to get the data schema. Note, for the idColumn and nameColumn variables above, they will end up with the attribute name that the column is bound to. So it might be something like nameColumn of “UsrCustomObject_UsrTitle_ssdkjxl” instead of the actual column name like “UsrTitle”. This will be useful to get the values for the bound page from these attributes.

Getting the Values for the Current Bound Object

Now that you have the attribute names for things like the primary Id column and the object’s primary display column, you can get the values from those attributes:

const idValue = await request.$context[idColumn];
const nameValue = await request.$context[nameColumn];

Conclusion

This sort of thing works great if you have a custom base page type that could be used for many different pages/objects, or if you have a custom override of a base Freedom UI page template that you won’t know ahead of time what the object using the template will be.

Also, as a FYI, not sure how this is going to change after Creatio 8.2.3. Creatio 8.2.3 has a beta feature (not enabled out of the box) that allows a page to have multiple connected data sources. That could potentially break some of this.

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

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.

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 Articles

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.

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.

Related Videos