Validating that a document is attached with the Approval

JVOGEL11
Tera Contributor

I would like an approver to attach a document with their approval.  If they hit 'Approve' without the attachment present, then it should prompt a message to add the attachment.    I also need this to work only when the 'ask for approval' is invoked from a particular flow (e.g., Process Shop Request).   I am thinking this might be a business rule or client script, but not sure the best approach.  Any thoughts are appreciated 🙂 

 

 

8 REPLIES 8

Sujatha V M
Kilo Patron
Kilo Patron

@JVOGEL11 : May be the below reference link might help you. 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0723548

 

Kindly modify according to your context such as table name, state change validation etc.  

 

Please mark this as helpful and accept it as a solution if this resolves your query.

 

Thanks, 

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Sujatha - thank you.  The script might solve half my problem.   I am thinking of applying this to the table: sysapproval_approver (during the approval with the approver).  However, I dont need to have the script applied to every approval, just those where the approval applies to specific type of service catalog item category and flow.   I don't see any fields in the sysapproval_approver where I can identify what category condition the UI script can be applied.  What would the script look like to check the item category that is related to this specific approval?   Would I be able to dot-walk in some way?

 

@JVOGEL11 : If I had understood it, you have a approval record as below and the field "document_id" references to the RITM record which inturn holds the field "Item" details. 

 

SujathaVM_0-1709559854944.png

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Mahesh23
Mega Sage

Hello,

 

You can create onsubmit client script and use GlideSysAttachment API to check existence of attachments on specific record.