Making attachments mandatory for subcategories

gourabhishe
Tera Contributor

Hello,

I have a requirement to make attachments mandatory in the CSM workspace when specific Sub-Category is selected.

I have tried UI policies and Business rules but it is not working.

Can someone suggest me how to implement this?

3 REPLIES 3

GlideFather
Tera Patron

Hi @gourabhishe,

 

can you share the UI policy and the corresponding actions that you created?

 

Business rule will not be the right way to achieve this. Instead try UI policy, Data Policy or Client script (depending on the exact process) and if you want to be applicable for form change only or list view as well... 

 

please share more context

_____
100 % GlideFather experience and 0 % generative AI

yashkamde
Kilo Sage

Hello @gourabhishe ,

 

Use BR (Before-Insert)

if (current.subcategory == '<sub-cat>') {
        
        if (!current.hasAttachments()) {
            gs.addErrorMessage('Attachments are mandatory for this sub category.');
            current.setAbortAction(true);
        }
    }

 

If my response helped mark as helpful and accept the solution.

 

Ankur Bawiskar
Tera Patron

@gourabhishe 

what BR you wrote?

what debugging did you do?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader