Restrict field edit on Project Workspace Planning Console
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi Everyone,
I want to restrict users from editing the 'End Date' field of a Project Task in the Planning Console based on the state of its parent Project.
I tried overriding the getConfig() method in 'ProjectWorkspaceColumnCriteria' script include to define the column criteria as follows:
var ProjectWorkspaceColumnCriteria = Class.create();
ProjectWorkspaceColumnCriteria.prototype = Object.extendsObject(ProjectWorkspaceColumnCriteriaSNC, {
getConfig: function(table) {
var config = {};
if (table === 'pm_project_task') {
config['end_date'] = {
criteria: 'parent.state=2',
requiredFields: ['parent.state']
};
}
gs.info('The config returned is: ' + JSON.stringify(config));
return config;
},
type: 'ProjectWorkspaceColumnCriteria'
});However, this configuration does not seem to have any impact on the editability of the End Date field in the Planning Console.
I would appreciate any guidance on how to achieve this functionality. Thanks in advance!
- Labels:
-
Project Portfolio Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
48m ago
Nobody has replied to this question yet. Looking at the script, there are a few likely causes. I can't Hi @Shaida Aslam ,
A few things in your override may stop it from working:
parent vs top_task. On pm_project_task, parent is the immediate parent, which may be another task rather than the project. To check the project's state, use top_task.state instead of parent.state.
You're replacing the OOB config. Your getConfig returns only your entry, so all the base criteria are lost. Merge with the base config instead:
getConfig: function(table) {
var config = ProjectWorkspaceColumnCriteriaSNC.prototype.getConfig.call(this, table) || {};
if (table == 'pm_project_task') {
config['end_date'] = {
criteria: 'top_task.state=2',
requiredFields: ['top_task.state']
};
}
return config;
},- Check what the criteria means. Confirm in ProjectWorkspaceColumnCriteriaSNC whether criteria defines when the field is editable or when it's read-only, as the logic may be the reverse of what you expect. Also check whether dot-walked fields are supported there. Clear the cache or reload the console after changes.
Recommended alternative: create a write ACL on pm_project_task.end_date with a condition or script on top_task.state. The Planning Console respects ACLs, and this enforces the rule server-side everywhere (forms, lists, APIs), not just in the console. It's also more upgrade-safe than overriding the Script Include.
If this answer helped you, please mark it as Helpful and Accept as Solution so others with the same question can find it.