Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

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?

6 REPLIES 6

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

Hi,

I have tried UI policy and Data policy but sys_attachments is not a field in the form so it is not available for selection to make it mandatory.

 

I have tried an onSubmit client script as well but it does not blocks me save.

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  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader