Hello Community,

 

We have a requirement for fetching all the column names of an object using source code.

 

I have taken this community post https://community.creatio.com/questions/get-title-columns-esq as reference and tried.

 

As per the article, the below code is used for fetching the column names after fetching the entity collection.

 titleColumnCaption = entity.Schema.Columns.GetByName("Title").Caption.Value;

But the code returns the null value.

 

Kindly let us know whether the above line of code is correct or not?

If not, suggest us an other way to achieve the functionality.

 

Thanks,

Sivaranjani

Like 0

Like

2 comments

Hello Sivaranjani,

 

It happens because the code above returns the "Title" column caption only and if your object doesn't have the column with such a name the result is null.

 

You need to use something like:

var columnCaptionsArray = activityEntity.Schema.Columns;
    foreach (var columnCaption in columnCaptionsArray)
    {
    	var captionForColumn = columnCaption.Caption.Value;
    }

and use the captionForColumn in your logic furhter.

 

Best regards,

Oscar

Oscar Dylan,

Thanks for the reply. The above code is working.

Show all comments

 Hi community,

I'm trying to disable the columns of an editable detail to make them read only and I have read many articles about it, but I'm still having a problem that I can't fix.



I wrote this code in the GridDetail to disable the fields but I noticed that for some of the columns of the detail is not working.

getCellControlsConfig: function(entitySchemaColumn) {
    if (!entitySchemaColumn) {
        return;
    }
    var columnName = entitySchemaColumn.name;
    var enabled = (entitySchemaColumn.usageType !== this.Terrasoft.EntitySchemaColumnUsageType.None) &&
        !this.Ext.Array.contains(this.systemColumns, columnName);
    var config = {
        itemType: this.Terrasoft.ViewItemType.MODEL_ITEM,
        name: columnName,
        labelConfig: {visible: false},
        caption: entitySchemaColumn.caption,
        enabled: enabled
    };
    if (!this.values.IsEnabled) {
        config.enabled = false;
        //config.labelConfig.enabled = false;
        //this.set("Is"+columnName+"enabled", false);
    }
    if (entitySchemaColumn.dataValueType === this.Terrasoft.DataValueType.LOOKUP) {
        config.showValueAsLink = false;
    }
    if (entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.DATE_TIME &&
        entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.BOOLEAN) {
        config.focused = {"bindTo": "Is" + columnName + "Focused"};
    }
    console.log(config);
    return config;
},

Debugging I have discovered that the detail adds to the labelConfig the property "enabled" which is binded to an attribute ("isProductenabled").

I tried to force the property writing it in the method and I also tried to set the attribute manually, but it's not working... do you have any idea?



Let me know.

Thanks in advance.



Best regards,

Luca

Like 0

Like

5 comments
Best reply

Luca Tavasanis,

While I was debugging I have noticed that the properties of the labelConfig that enabled some of the fields where added in the method: "applyBusinessRulesForActiveRow: function(id, gridLayoutItems)" and to fix the issue I just added this method in the client module.

You can lock the fields in the editable detail using business rules on the page for the detail, rather than in code. On the page for the detail, add a business rule to make the field not editable. Something like 

Condition: Boolean true = Boolean false (something that is never true)

Then: Make field editable (the condition is never true, so field is never editable)

The business rule will apply to the detail list and the fields will not be editable in the detail list.

Ryan

Hi Ryan,

I'm actually working with the BaseGridDetail so I can't lock it with a business rule... do you have any other idea?

 

Thanks anyway.

Luca

Luca Tavasanis,

IIRC to do it in code I usually do it like this (but unable to verify if this is correct at the moment)

getCellControlsConfig: function(entitySchemaColumn) {
    // get config from base 
    var config = this.mixins.ConfigurationGridUtilities.getCellControlsConfig.apply(this, arguments);
    var columnName = entitySchemaColumn.name;
 
    // if this is the column I want to disable
    if (columnName === "UsrMyColumn") {
        Ext.apply(config, {
            enabled: false
        });
    }
 
    return config;
}

Hopefully that gets you closer, of course, if you're wanting to disable all, you could just remove the if to check the column it's for.

Ryan

Ryan Farley,

I just tried what you suggested but unfortunately it's not working... it returns an error when I use this.callParent(arguments);.

Thank you anyway.



Luca

Luca Tavasanis,

While I was debugging I have noticed that the properties of the labelConfig that enabled some of the fields where added in the method: "applyBusinessRulesForActiveRow: function(id, gridLayoutItems)" and to fix the issue I just added this method in the client module.

Show all comments

Hi,

I am using Creatio 7.14. I have a custom detail with a Price field of Decimal datatype. I know that we can define precision to 1, 2, 3, 4 or 8 decimal places. Is there a way to set it to 5? Attached is the image for the current setup of the detail.

Instead of displaying as 0.00003000, I need to display as 0.00003. 

I was able to achieve it in Detail Edit page by adding the below attribute to the field in diff:

"controlConfig": {

                        decimalPrecision: 5

                    }

 

I need to achieve the same in Detail Grid as well. I followed the community articles to create a module from scratch to extend Terrasoft.Grid:

https://community.creatio.com/questions/hyperlink-fields

https://community.creatio.com/questions/substitutionreplacing-modules

https://community.creatio.com/questions/custom-detail-hyperlink-get-fil…

 

-------------------------------------

define("UsrConfigurationGrid", ["Terrasoft.Grid"], function() {

    Ext.define("Terrasoft.configuration.UsrConfigurationGrid", {

        extend: "Terrasoft.Grid",

        alternateClassName: "Terrasoft.UsrConfigurationGrid",

        // change methods here 

        formatCellContent: function(htmlConfig, data, column) {

            if(column==="UsrTrtPrice")

            {

                data.UsrTrtPrice = parseFloat(data.UsrTrtPrice).toFixed(5);

            }

            return this.callParent(arguments);

        }

            

    });

    

    return Terrasoft.UsrConfigurationGrid;

});

-------------------------------------

Is this the correct way to do it? How should I proceed from here? Do I need to add "UsrConfigurationGrid" as a dependency in Detail Grid Page as:

----------------------------------------------

define("O1SessionDetailGrid", ["ConfigurationGrid", "ConfigurationGridGenerator",

    "ConfigurationGridUtilities","ProcessModuleUtilities","UsrConfigurationGrid"], function(ProcessModuleUtilities) {

    return {.......

----------------------------------------------

Should I remove "ConfigurationGrid" which was added to make the grid editable? The above setting does not seem to be working as the detail is not getting displayed after adding "UsrConfigurationGrid".

I would appreciate if anyone could provide any thoughts on this.

 

File attachments
Like 0

Like

2 comments
Best reply

Hi,

 

There is an easier way to achieve a custom precision for the column: in the grid detail schema you need to override the getGridRowViewModelConfig method. For example I've created a replacing view model for the OrderProductDetailV2 and specified the following code there:

define("OrderProductDetailV2", ["MoneyModule", "css!OrderPageV2Styles", "css!SummaryModuleV2"], function(MoneyModule) {
	return {
		entitySchemaName: "OrderProduct",
		messages: {},
		attributes: {},
		methods: {
			getGridRowViewModelConfig: function(config) {
				var gridRowViewModelConfig = this.callParent(arguments);
				gridRowViewModelConfig.rowConfig.UsrDecForTests.precision=6;
				return gridRowViewModelConfig;
			}
		},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

In this case all the values in the precision for the "UsrDecForTests" decimal column (that is Decimal (0.00000001) data type) in the "Products" detail on the order page will be set to 6:

and

and

So you can try the following approach on your end.

 

Best regards,

Oscar

Hi,

 

There is an easier way to achieve a custom precision for the column: in the grid detail schema you need to override the getGridRowViewModelConfig method. For example I've created a replacing view model for the OrderProductDetailV2 and specified the following code there:

define("OrderProductDetailV2", ["MoneyModule", "css!OrderPageV2Styles", "css!SummaryModuleV2"], function(MoneyModule) {
	return {
		entitySchemaName: "OrderProduct",
		messages: {},
		attributes: {},
		methods: {
			getGridRowViewModelConfig: function(config) {
				var gridRowViewModelConfig = this.callParent(arguments);
				gridRowViewModelConfig.rowConfig.UsrDecForTests.precision=6;
				return gridRowViewModelConfig;
			}
		},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

In this case all the values in the precision for the "UsrDecForTests" decimal column (that is Decimal (0.00000001) data type) in the "Products" detail on the order page will be set to 6:

and

and

So you can try the following approach on your end.

 

Best regards,

Oscar

That's exactly what I needed. Thank you, Oscar!

Show all comments

Hello Community,

 

Is possible to extend numer of column on grid view ?

Eg. To display more than 24 coulmns on ProductSectionV2.  It could be development solution or any hint.

 

Regards,

Marcin Kott

Like 0

Like

3 comments

Dear Marcin,

 

As for now, there is no workaround to increase the number of columns in grid view. I recommend using the tile view. For this view, it`s possible to more flexibly adjust the number of displayed columns and their size.

 

Best regards,

Angela

Hi Angela,

 

Angela Reyes writes:

Dear Marcin,

As for now, there is no workaround to increase the number of columns in grid view. I recommend using the tile view. For this view, it`s possible to more flexibly adjust the number of displayed columns and their size.

Best regards,

Angela

MoreLess

1 page only 2 records (if you have more than 50 fields, 1 record in 1 page)

 

24 fields list view, cannot see any things - cannot remove field after add 24 fields in settings

Hope that Creatio improve horizon scroll for list view, and user can adjust wide column without open list setup page.

 

Regards,

Akira Nguyen

Hi,

 

Yes, You have a right but for this i have solution (even two or both of):

- in case of horizontal scrolling have a look how to achive this on grid

https://community.creatio.com/ideas/horizontal-view-section-and-detail

- in case of expand visibility of grid You may use add'on

https://marketplace.creatio.com/app/expandable-details-creatio

 

So only what i'm looking for is the possibility to increase list view column limitation.

 

Regards,

Marcin

Show all comments

How can I get bigger font for name in custom section.

Here is the pic of Contact section (in-buily) with Name shown in big fonts in tile view.

Now I have built my custom Contact section but with few changes. It is not replaced or inherited with actual Contact section.

Now in the section after removing caption of the field the font size of name is still small.

 

How can I get bigger font like in in-built/out of the box contact Section.

I want to apply it to other sections also. So there is no point to use out of the box Contact section by replacing object which already has big fonts.

Like 0

Like

3 comments

Hi Ramnath.

 

You can change the font size by adding a custom css style to the schema you need and in such a way override the system font-size. Please refer to this article on our community: https://community.bpmonline.com/questions/how-add-custom-style-control-page-based-condition

I recommend you change a font-size first for any page in the system to check if it looks fine as we do not guarantee that all objects, labels, and containers will be displayed correctly. 



Thank you.

Bohdan Zdor,

 

I have tried this before but I could only make it work on the page of arecord. I need to edit the page where all the records are shown. I could not find the module which has the code for the list of records.

 

Ramnath

RAMNATH SHARMA,

 

 

Unfortunately, there is no option to change the section list font size in the current version of the system. I have registered your suggestion, though. It was passed to our R&D team to be considered for further releases.

 

Thank you. 

Show all comments

For instance, I have a column Account.UsrFlagTemp.

I don't need it anymore and I want to delete it.

But I want to search through all the processes to find out if any process still uses it.

Is there a way to do it automatically?

This is the cloud version.

Like 0

Like

1 comments

Hello Yuriy,

 

We do not recommend to delete columns in general, if you do not need this column you can set its usage mode to "none". If any process in your system reads all columns from the Account object this process will stop working after the column is removed even if the column itself is not used. 



This is why it is better to change usage mode in the column setup in the configuration. 

 

Best regards,

Angela

Show all comments

Hi,

I am trying to setup the columns to view in the relationships detail for a client but I can not see Start Date and End Date.

The fields are there in the schema but on the page, they look different (Screenshots attached).

I want to add Start Date and End Date of the relationships to the view. Please help me with this.

 

Like 0

Like

1 comments

Firstly you need to add the columns to the view VwContactRelationship. Please deploy the application locally and create a script that will modify the view. Then add the columns to the related object. Then the columns will appear in the section wizard. 

Show all comments