GRC Choices dependency
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 05:05 AM
Hi Team,
Is there a way we can make grc choices dependent? For eg:
In control objectives form, requirement is to make classification dependent on Category.
For sys_choice, we do have dependent value but i dont see that in sn_grc_choice.
Have anyone built this type of requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 05:54 AM
Mentioned column type is reference. So what you can do, add column parent in "sn_grc_choice" table and update reference qualifier to make this dependency.
new sn_grc.GRCChoiceUtils().getGRCChoices('category', current.sys_class_name)
new sn_grc.GRCChoiceUtils().getGRCChoices('type', current.sys_class_name)
new sn_grc.GRCChoiceUtils().getGRCChoices('classification', current.sys_class_name)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 06:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 06:35 AM
As i mentioned, first add parent (Referencing to "sn_grc_choice") column in GRC choice list table and update your choice with correct parent. And script as below,
Current,
getGRCChoices: function(category, currClassName) {
return 'choice_category=' + category + '^set=' + this.setTableMap[currClassName];
},
Update to,
getGRCChoicesWithDependent: function(category, currClassName, dependentColumn, current) {
return 'choice_category=' + category + '^set=' + this.setTableMap[currClassName]+ '^u_parent='+ current.getValue(dependentColumn);
},
And update your reference quqlifer script with new function,
new sn_grc.GRCChoiceUtils().getGRCChoicesWithDependent('classification', current.sys_class_name, 'category', current)