I've seen this post,

https://community.creatio.com/articles/how-can-i-change-detail-caption-depending-page

Is it possible to use the same logic to change the detail columns captions too (depending on the page) ?

(binding the detail column caption to a property works when I open a detail row for edition, but we need it to happen when the detail is shown on the object edit page)

Like 0

Like

1 comments

Hi Ricardo,

 

The logic that forms the name of the columns in the Grid is stored in the SysPorfileData table and the actual ObjectData column value is formed using base addProfileColumns method (that is a part of Profile that consists of tiledConfig (config for tiled columns display) and listedConfig (listed columns display config)). Modifying the base logic will be hard (either overriding addProfileColumns and modifying configs or creating a trigger on the database level that will update the SysPorfileData table for the detail grid setup). We don't recommend modifying the logic and recommend using multiple edit pages and setup detail column names separately in different pages.

 

Best regards,

Oscar

Show all comments

Hi Team,

 

I'm trying to set a caption for a field dynamically in onNotificationsLoad: function(isPageable, items) of ProcessDashboardSchema (this schema is replaced).

 

I'm iterating a collection and finding a value via ESQ and try setting the caption to a field but its not executing. Then, i tried to see the value in console, the main function doesn't  wait for the internal function to complete though i had used the callback.

 

NOTE: Please find the attachment for reference.

 

Thanks in advance!

 

Regards,

Bhoobalan P.

 

 

 

attributes: {

"connectedRecordCaption": {

"dataValueType": this.Terrasoft.DataValueType.STRING,

"Value": "ConnetcedRecord"

},

},

methods:{

onNotificationsLoad: function(isPageable, items) { 

    var opportunityName = "sample";

    this.console.log("from loadNotifications function");

    items.eachKey(function(key, item) {

    this.getConnectedRecordName(item,function(response){

    var entityID = response;

    if(entityID){

     this.getOpportunityName(entityID,function(response){

            opportunityName = response;

            this.set("connectedRecordCaption",opportunityName); (Not Setting)

            this.console.log(opportunityName);

        },this);

    }

},this);

}, this);

this.console.log("after loaded");

},



getConnectedRecordName : function(item,callback,scope){

//Logic to Fetch the entityID

var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "SysProcessEntity" });

esq.getEntityCollection(function (result) {

if (result.success && result.collection.getCount() > 0) {

var item = result.collection.getByIndex(0);

var entityId =  item.get("EntityId");

callback.call(scope || this, entityId);    

}

}, this);

},

getOpportunityName : function(entityId, callback,scope){

//Logic to Fetch the Opportunity Name

var esqActivity = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "Activity" });

esqActivity.getEntityCollection(function (result) {

if (result.success && result.collection.getCount() > 0) {

var item = result.collection.getByIndex(0);

oppName = item.get("OpportunityName");

callback.call(scope || this, oppName);    

}

}, this);

},

}

diff:[

{

"operation": "insert",

"name": "ConnectedRecord",

"parentName": "ConnectedRecordContainer",

"propertyName": "items",

"index": 1,

"values": {

"itemType": Terrasoft.ViewItemType.HYPERLINK,

//Resources.Strings.customCaption

"caption": {"bindTo": "connectedRecordCaption"},

"click": {"bindTo": "onConnectedRecordClick"},

"classes": {

"hyperlinkClass": ["title-text-labelClass"]

},

"canExecute": {"bindTo": "canBeDestroyed"}

}

},]

File attachments
Like 0

Like

2 comments

Glancing through the code, nothing is standing out, however, based on your screenshot (at the expected result) and matching up with the code, the console.log("after loaded") will always execute before the results of the callback functions since it's outside of those. 

I assume it's not setting your caption for the hyperlink? If that is the case, I'd start with making sure you're getting back the desired results from the ESQs in the callback functions (looks like you are based on the screenshot). Double-check to make sure all the code is inside the callbacks and not after. Worst case, you could move all the inline callback functions to actual functions and just call them from inside the ESQ callback.

Ryan

Hi Bhoobalan,

 

Additionally to Ryan's response you are using the "connectedRecordCaption" as an attribute in the schema. Maybe it would be easier to replace the SysProcessElementToDo object and add the connectedRecord column to the object and set the value for it using the onNotificationsLoad function as you did.

 

Best regards,

Oscar

Show all comments