yes I need all of the actions under that Button
Then use this code:
if (Ex2ValidFields()) {
try {
var annot = this.addAnnot({
page: 0,
type: "FileAttachment",
point: [500, 500],
noView: true,
author: "Attachment"
});
annot.cAttachmentPath;
var attachmentObj = annot.attachment;
if (attachmentObj !== null) {
app.alert("file successfully added: " + attachmentObj.name,3, 0, "Pedido de Investimento");
var l = this.getField("lst1");
l.insertItemAt(attachmentObj.name, 2);
}
}
catch(e) {
if (e.name == "NotAllowedError") {
// do nothing
}
}
this.getField("Validacaochefia-direcao").display = display.visible;
this.getField("NOKDIRECAO").display = display.visible;
this.getField("Direcao").display = display.visible;
this.getField("ObsDIRECAO").display = display.visible;
this.mailDoc({
cTo: "marlene.marques@kirchhoff-automotive.com",
cCc: "bernardo.brandao@kirchhoff-automotive.com",
cSubject: "Pedido de Investimento - VALIDAÇÃO",
cMsg: "Cara Marlene,\n\nEm anexo envio o Pedido de Investimento devidamente preenchido, por favor validar se a informação está conforme o exigido, para mais informações, disponha.\n\nObrigado."
});
}