SHARE
TWEET

Fluig - Verificar se documento foi anexado

EvaldoMaciel May 27th, 2020 534 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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top