Advertisement
EvaldoMaciel

Fluig - Verificar se documento foi anexado

May 27th, 2020
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function beforeTaskSave(colleagueId, nextSequenceId, userList) {
  2.     var attachments = hAPI.listAttachments();
  3.     var hasAttachment = false;
  4.  
  5.     for (var i = 0; i < attachments.size(); i++) {
  6.         var attachment = attachments.get(i);
  7.         if (attachment.getDocumentDescription() == "fluig.pdf") {
  8.             hasAttachment = true;
  9.         }
  10.     }
  11.  
  12.     if (!hasAttachment) {
  13.         throw "Erro... Não há anexo fluig.pdf!";
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement