Question

Lock price in product detail

Hi Team, 

 

I'm trying to lock the price (readonly) with this code but seams to be not working.

			getCellControlsConfig: function(entitySchemaColumn) {
				var columnName = entitySchemaColumn.name;
				var enabled = (entitySchemaColumn.usageType !== Terrasoft.EntitySchemaColumnUsageType.None) &&
					!Ext.Array.contains(this.systemColumns, columnName);
				if (columnName == "Price") {
					var config = this.getDefaultCellControlsConfig(columnName, {
						enabled: false,
						caption: entitySchemaColumn.caption
					});
				} else {
					var config = this.getDefaultCellControlsConfig(columnName, {
						enabled: enabled,
						caption: entitySchemaColumn.caption
					});
				}
 
				if (entitySchemaColumn.dataValueType === Terrasoft.DataValueType.LOOKUP) {
					config.showValueAsLink = false;
				}
				if (entitySchemaColumn.dataValueType !== Terrasoft.DataValueType.DATE_TIME &&
					entitySchemaColumn.dataValueType !== Terrasoft.DataValueType.BOOLEAN) {
					config.focused = {"bindTo": "Is" + columnName + "Focused"};
				}
				return config;
			}

 

 

 

 

Like 0

Like

2 comments

Hi,



Altenatively, you can add Business rules based on your condition and for for the business rule to work properly for editable list detail, you have to enable the feature 'LoadLookupColumnsInEditGrid'.



For enabling that feature you need to run the below script if you SQL Console or you can request Creatio support they will run do the same from their end.



DECLARE @featureCode varchar(max) = 'LoadLookupColumnsInEditGrid',

 @featureId uniqueidentifier;

set @featureId = (select top 1 Id from Feature where Code = @featureCode);

IF @featureId is null

BEGIN

 insert into Feature

  (Name, Code)

 values

  (@featureCode, @featureCode);

 set @featureId = (select top 1 Id from Feature where Code = @featureCode);

END;

delete from AdminUnitFeatureState where FeatureId = @featureId;

insert into AdminUnitFeatureState

 (SysAdminUnitId, FeatureState, FeatureId)

values

 ('A29A3BA5-4B0D-DE11-9A51-005056C00008', 1, @featureId);





Thanks,

Sivaranjani

Hi Sivaranjani, 

Thanks, I disabled the BR that enabled the field as a editable.

 

Show all comments