Hello again everyone.
I have the code below which is a button to generate an email and also make a check box visible on a form going out to a customer. I have an employee signature box which flattens the form except for this button and the customer signature fields. The code is in a mouse up javascript within the action tab of the button.
The code works in the fact it generates the email and makes the check box visible when attached to the email message, however no matter where I locate the code to hide the button its still visible when the PDF is opened from the received email. Can anyone suggest how I can make this work as intended please
try {
var cb = this.getField("yes");
if (cb) {
cb.display = display.visible;
cb.value = "Off";
}
this.display = display.hidden;
var cToAddr = this.getField("8") ? this.getField("8").valueAsString : "";
var cCustomer = this.getField("4") ? this.getField("4").value : "";
var cMake = this.getField("12") ? this.getField("12").value : "";
var cUnit = this.getField("14") ? this.getField("14").value : "";
var cSubLine = "Machine Service Contract" + " - " + cCustomer + " - " + cMake + " " + cUnit;
var cBody = "Please find attached the Service Contract for the above machine." +
" Please make sure to read the terms fully before signing.";
this.mailDoc({
bUI: true,
cTo: cToAddr,
cCc: cCc,
cSubject: cSubLine,
cMsg: cBody
});
} catch (e) {
app.alert("Error: " + e.message);
}