Receiving the "Displayed value" column values via esq

Question

I want to perform ESQ from rootSchemaName: "X". How do I know which object property is its text view (the column value displayed in the screenshot)?

We receive responses to some requests that are not mine. In these responses, there are objects with the displayValue property, which is exactly what I need.

Example of a code:

var select = Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: dimensionItem.get("SysSchemaName")
});
 
select.getEntityCollection(function(response) {
    if (response.success) {
        var collection = response.collection;
        if (collection && collection.getCount() > 0) {
 
        }
    }
})

Answer

To receive the column values marked as Displayed name in an object via esq, use the esq.addMacrosColumn() esq method.

Example of a code:

var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: 'UsrTestObj'
});
esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_DISPLAY_COLUMN, "displayValue");
esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_COLUMN, "value");
esq.getEntityCollection(function(result) {
    if (result.success) {
        debugger;
    }
}, this);

As a result, you receive the Id column value collection and the column marked as Displayed value from the UsrTestObj table.

Like 0

Like

Share

2 comments

Hi,



Is there a way to do this in C#?



Thank you.

Solem Khan Abdusalam,

For server-side C# ESQ, the entities returned by GetEntity and GetEntityCollection include a property for this:

var displayText = entity.PrimaryDisplayColumnValue;

Ryan

Show all comments