Playbook Attachments Mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 11:31 AM
Hello, I'm wanting to make adding an attachment to the playbook activity mandatory. As in the User can not move on to the next activity until an attachment is attached and a notification pops up informing the User of this requirement. Does anyone know how I can make this happen? I was told that maybe using UI Policies in combination with Client Scripts but I have not been successful. Currently I can add attachments, but I can't make them Mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 01:34 PM
Please try this:
1. Create a UI script called: "setAttachmentMandatory". Set UI Type to "All".
Put this in the script section.
(function() {
"use strict";
return {
setAttachmentMandatory: function(isMandatory) {
var isSuccess;
try {
angular.element("#sc_cat_item").scope().c.data.sc_cat_item.mandatory_attachment = isMandatory;
isSuccess = true;
} catch (e) {
isSuccess = false;
//gs.log('setAttachmentMandatory() failed: ' + e);
}
return isSuccess;
},
type: "AttachmentUtil"
};
})();
2. Then create client script/UI Police (as you may wish)... and add this script:
Make sure to check the "isolate script" and set UI Type to "All"
if (g_form.getValue('test') == 'Yes') {
g_ui_scripts.getUIScript('setAttachmentMandatory').then(function (script) {
script.setAttachmentMandatory(true);
});
} else {
g_ui_scripts.getUIScript('setAttachmentMandatory').then(function (script) {
script.setAttachmentMandatory(false);
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 02:30 PM
Thank you I'll give this a try and report back in a day or so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2025 08:22 AM
Thank you folusho! only one questions, for the client script/UI policy, what table does this need to be created on, we are creating the playbooks off of the 'pm_project_task' table but the playbook activity cards are captured on an entirely separate table here 'sys_pd_activity_context'. With that being said after creating the UI script, could you provide some guidance on what to do with the clientscript/ui policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 07:50 AM