Boa tarde!
Estou tendo um erro no log que informa que é referente ao beforeTask porém não descobri oq fazer para arrumar esse erro, gostaria de ajuda.
Erro:
INFO [com.datasul.technology.webdesk.customization.ScriptingLog] (default task-37206) InternalError: Cannot convert entrega to java.lang.Integer (beforeTaskSave#31)
codigo do beforeTask:
function beforeTaskSave(colleagueId,nextSequenceId,userList){
var atv_inicio = 68;
if(nextSequenceId == atv_inicio /*&& getValue("WKCompletTask").equals("true")*/) {
var assunto = "Processo compras";
var msgInicial = "";
var msgFinal = "";
var destinatarios = userList;
log.info("##** destinatarios" + destinatarios);
enviaEmail(assunto, destinatarios, msgInicial, msgFinal, atv_inicio);
}
function enviaEmail(assunto, destinatarios, msgInicial, msgFinal, atividade) {
var processo = getValue("WKNumProces").toString();
try{
var parametros = new java.util.HashMap();
var subject = "[WF" + processo + "] - Requisição de compra"
parametros.put("SOLICITACAO_", processo);
parametros.put("PRAZO_ENTREGA", hAPI.getCardData("entrega"));
parametros.put("PREVISAO_ORC", hAPI.getCardData("valor"));
parametros.put("OBSER_VACAO", hAPI.getCardData("observacao"));
var tabelaItens = montarItens();
parametros.put("TABLE_ITENS", tabelaItens);
var notificacao = notifier.notify("1275", "outroTeste", parametros, destinatarios, "text/html");
} catch (error) {
log.info("##** Erro no envio de email");
log.info(error);
}
}
function montarItens() {
var html = "";
html += " <table>";
html += " <thead>";
html += " <tr>";
html += " <th>Quantidade</th>";
html += " <th>Descrição</th>";
html += " </tr>";
html += " </thead>";
html += " <tbody>";
var processo = getValue("WKNumProces");
var campos = hAPI.getCardData(processo);
var contador = campos.keyset().iterator();
while (contador.hasNext()) {
var id = contador.next();
if (id.match(/it_Quantidade___/)) {
var campo = campos.get(id);
var id = id.split("___")[1];
var quantidades = campos.get("it_Quantidade___" + id);
var descricoes = campos.get("it_Descricao___" + id);
html += "<tr>"
html += " <td style= 'text-aling:center'>" + quantidades + "<td>";
html += " <td style= 'text-aling:center'>" + descricoes + "<td>";
html += "</tr>"
log.info("#%$ retorno");
log.info(html);
}
}
html += "</tbody></table>"
return html
}
}