Query To Find Objects Related To Another Object in Creatio

If you need to determine the objects that are related to another object in Creatio, there’s a few ways to do this. For example, let’s say you want to find all of the objects that have a relationship to the account object – meaning, find all the objects that have an account lookup. We’ll take a look at two different ways to do this in Creatio.

Via SQL Query

-- find objects related to Account
select 
	distinct "SysSchema"."Name" as "SysSchemaName"
from 
	"SysEntitySchemaReference"
	inner join "SysSchema" on "SysSchema"."Id" = "SysEntitySchemaReference"."SysSchemaId"
	inner join "SysSchema" as "ReferenceSchema" on "ReferenceSchema"."Id" = "SysEntitySchemaReference"."ReferenceSchemaId"
where 
	"ReferenceSchema"."Name" = 'Account'

The above will allow you to run a SQL query to get the names of all related objects. Note, this will work as-is for both MSSQL and Postgresql as well. Also note, however, this will return not just objects that are normal objects that represent tables in Creatio, but also virtual objects and objects that represent views.

Via a Select Object

var objectToFindRelatedObjectsFor = "Account";

var select = new Select(UserConnection)
	.Distinct()
	.Column("SysSchema", "Name").As("SysSchemaName")
	.From("SysEntitySchemaReference")
	.InnerJoin("SysSchema").On("SysSchema", "Id").IsEqual("SysSchemaId")
	.InnerJoin("SysSchema").As("ReferenceSchema").On("ReferenceSchema", "Id").IsEqual("ReferenceSchemaId")
	.Where("ReferenceSchema", "Name").IsEqual(Column.Parameter(objectToFindRelatedObjectsFor))
	as Select;

using (DBExecutor dbExecutor = UserConnection.EnsureDBConnection())
{
	using (IDataReader reader = select.ExecuteReader(dbExecutor))
	{
		while (reader.Read())
		{
			var sysSchemaName = reader.GetColumnValue<string>("SysSchemaName");
			// sysSchemaName contains the name of a related object
		}
	}
}

If you need to do this in code in Creatio, you can do it with a Select object as shown above.

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