Hi All,
I am trying to lock all the fields on a page. So I have followed the following article:
I have set the value of IsModelItemsEnabled to false in methods of the edit page in following ways,
- setCardLockoutStatus: function() {
this.set("IsModelItemsEnabled", false);
}, - onEntityInitialized: function(){
this.callParent(arguments);
this.set("IsModelItemsEnabled", false);
},
But still all the fields are editable. Can anyone suggest what am I doing wrong?
Like
Hi,
Tested on the AccountPageV2 schema and it worked properly:
1) Enable the feature via the database:
DECLARE @allEmpoyeeGroupName nvarchar(max) = 'All employees'; DECLARE @featureName nvarchar(max) = 'CompleteCardLockout' DECLARE @featureStatus bit = 1; IF (NOT EXISTS (SELECT NULL FROM Feature WHERE Code = @featureName)) BEGIN INSERT INTO Feature (Name, Description, Code, ProcessListeners) VALUES (@featureName, @featureName, @featureName, 0) END IF(EXISTS (SELECT NULL FROM AdminUnitFeatureState WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName)) ) BEGIN UPDATE AdminUnitFeatureState SET FeatureState = @featureStatus WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName) END ELSE BEGIN INSERT INTO AdminUnitFeatureState (ProcessListeners, SysAdminUnitId, FeatureState, FeatureId) VALUES ( 0, (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName), @featureStatus, (SELECT Id FROM Feature WHERE Code = @featureName) ) END
2) In the AccountPageV2 added the following code to the diff array:
{ "operation": "merge", "name": "CardContentWrapper", "values": { "generator": "DisableControlsGenerator.generatePartial" } },
3) In the AccountPageV2 added the following attribute:
"IsModelItemsEnabled": { dataValueType: Terrasoft.DataValueType.BOOLEAN, value: false },
4) Relogin to the app
5) Open account edit page
6) All the fields are locked
Best regards,
Oscar
Hi,
Tested on the AccountPageV2 schema and it worked properly:
1) Enable the feature via the database:
DECLARE @allEmpoyeeGroupName nvarchar(max) = 'All employees'; DECLARE @featureName nvarchar(max) = 'CompleteCardLockout' DECLARE @featureStatus bit = 1; IF (NOT EXISTS (SELECT NULL FROM Feature WHERE Code = @featureName)) BEGIN INSERT INTO Feature (Name, Description, Code, ProcessListeners) VALUES (@featureName, @featureName, @featureName, 0) END IF(EXISTS (SELECT NULL FROM AdminUnitFeatureState WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName)) ) BEGIN UPDATE AdminUnitFeatureState SET FeatureState = @featureStatus WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName) END ELSE BEGIN INSERT INTO AdminUnitFeatureState (ProcessListeners, SysAdminUnitId, FeatureState, FeatureId) VALUES ( 0, (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName), @featureStatus, (SELECT Id FROM Feature WHERE Code = @featureName) ) END
2) In the AccountPageV2 added the following code to the diff array:
{ "operation": "merge", "name": "CardContentWrapper", "values": { "generator": "DisableControlsGenerator.generatePartial" } },
3) In the AccountPageV2 added the following attribute:
"IsModelItemsEnabled": { dataValueType: Terrasoft.DataValueType.BOOLEAN, value: false },
4) Relogin to the app
5) Open account edit page
6) All the fields are locked
Best regards,
Oscar
Oscar Dylan,
I have tried this and able achieve my objective. Apparently what I was missing was, I have not added the code in diff array. Thank you so much for your time & effort.
Regards,
Sourav Kumar Samal