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

How to make knowledge article attachment mandatory on incident form based on resolution code choice.

snow_beginner
Giga Guru

Hi,

So there is a requirement that if the 'Resolution Code' = Known Error on the incident form then an attachment needs to be mandatory of a Knowledge article. How would I achieve that functionality? To make the (📎) thats on top of the form mandatory, what would be needed?

1 ACCEPTED SOLUTION

vermaamit16
Kilo Patron

Hi @snow_beginner 

 

Make a Business Rule as below on the incident table :

 

AmitVerma_0-1706870973727.png

 

AmitVerma_1-1706870993164.png

 

(function executeRule(current, previous /*null when async*/ ) {

    if (current.hasAttachments() != true) {

        gs.addInfoMessage("Please add a relevant knowledge article to proceed!!!");

		current.setAbortAction(true);

    }

})(current, previous);

 

Output :

 

AmitVerma_2-1706871169868.png

 

Thanks & Regards

Amit Verma

Thanks and Regards
Amit Verma

View solution in original post

6 REPLIES 6

@Akansha Gupta 

 

Preferred way would be Business Rule as client script requires DOM Manipulation.

Thanks and Regards
Amit Verma

@vermaamit16 - thanks a lot for your help!