I've designed an eForm that is intended to be filled out in Reader, printed, signed, then submitted for processing. I have a number of required fields and have created the logic (in the PrePrint event) to check that these fields are populated, generating an error message if the check fails.
Thanks for the link, but I've already got that logic working (took it from the "LoopThroughFields.xdp" sample) from the Click event on a generic button. What I'm wanting to do is call this checking function within the Print Button click event in order to have it process as one seamless event. However, IF the checking function returns at least one mandatory field that was not entered, we need to abort the print event.
Would it work to have your own "print" button with the editting logic in the click event and if all is well call the print function yourself?
An ugly alternative would be to display the error message, including a plea for them to cancel the print. You might also be able to make all the fields non-printing until the edits are successfully passed.
Good point Tom. I thought about building my error handling logic into the Print Button, using an If/Then statement. IE, If no errors exist, then make the xfa.host.print call. Unfortunately, taking the error logic out of the PrePrint event (where it currently sits) will leave a hole if the user were to go File/Print, correct?
At the moment, the current approach throws up a message box informing the operator of the field(s) needed entry, with notification that incomplete forms will take longer to process...maybe that will be sufficient for this particular opportunity.