Expand my Community achievements bar.

Deny script fails in ReaderX, Works in Reader9

Avatar

Level 3

I have a scripts that checks to ensure users have added Denial comments.  If the leave the Comment field blank then it gives a pop-up to puts the focus into the comment field.  It works perfect with Reader9 ...but doesn't recognize the comments in ReaderX now.  What is really strange is if you leave the form open in Workspace for 10 minutes or so, THEN I can hit the Deny button.  Weird.  But initially when you open the form, it doesn't acknowledge the comments.  Any ideas?  Below is the snippet:

TDCR.Page1.ProcessFields.AWS_SUBMIT::click - (JavaScript, client)

// This is the AWS_SUBMIT click script

if

(xfa.host.name == "Acrobat")

{

// get the local URL of the PDF, to check to see if it's a file on disk or from the web.

var sURL = event.target.URL;

if (sURL == null) sURL = "";

// we can email only if there is a Workflow Server email address.

// we allow email submission only if the pdf is loaded from disk (not in a browser)

// Detecting if it is from local disk is by seeing if the URL starts with file:// (rather than htpp://, for instance)

if ( (sURL.indexOf("file://") == 0) )

{

if (AWS_STATUS.rawValue == "Submitted") {

app.alert("This task item has already been submitted.");

bSubmit

= false;

}

else {

// set this boolean to false if any of the criteria fails

var bEmail = true;

// check for an empty LiveCycle server email address

if (AWS_MAILTO.rawValue == null || AWS_MAILTO.rawValue == "") {

// prompt for an email address to send the submission to

AWS_MAILTO.rawValue

= app.response("This form does not contain the email address for a LiveCycle Server. Please enter the LiveCycle Server email address now.", "Task Item Submission Information");

if (AWS_MAILTO.rawValue == null || AWS_MAILTO.rawValue == "") {

bEmail

= false;

}

}

// check for either a taskId or a business process name

// If there is a taskId it is presumed that you are "participating"

// in the middle of a business process, whereas if there is no

// taskId it is presumed that you want to "initiate" a new

// business process.

// if there is no taskId, prompt for the business process name

if (bEmail) {

if ( (AWS_TASKID.rawValue == null || AWS_TASKID.rawValue == "") &&

(AWS_PROCESSTYPE.rawValue

== null || AWS_PROCESSTYPE.rawValue == "") ) {

// prompt for the business process name

AWS_PROCESSTYPE.rawValue

= app.response("This form does not contain a taskId or a business process name. Please enter the business process name that you wish to initiate with this form.", "Task Item Submission Information");

if (AWS_PROCESSTYPE.rawValue == null || AWS_PROCESSTYPE.rawValue == "") {

bEmail

= false;

}

}

}

if (bEmail) {

var _mailto = AWS_MAILTO.rawValue;

if (_mailto.indexOf("mailto:") != 0)

_mailto

= "mailto:" + _mailto;

event.target.submitForm({cURL

: _mailto,

bEmpty

: true, // Post all fields (true), or do Not post all fields (false)

cSubmitAs

: AWS_SUBMIT_TYPE.rawValue, // Post in XDP or PDF format

cCharset

: "utf-8"});

// set status to "Submitted" so that another send is not attempted via email.

AWS_STATUS.rawValue

= "Submitted";

}

}

}

else { // The PDF did not originate from file:// (i.e. not from local disk)

// do a normal web acrobat submit

if(AWS_SUBMIT_TYPE.rawValue == "PDF"){

PDF_SUBMIT.execEvent("click");

}

else{

var sAction = TDCR.Page1.ProcessFields.AWS_ACTION.rawValue;

//FSSUBMIT_.execEvent("click");

if(sAction == "Approve"){

//xfa.host.messageBox("Approve Clicked");

FSSUBMIT_.execEvent("click");

}

if ( sAction == "Deny" ) {

if ( TDCR.Page1.Approve_subform.AppComments_1.isNull || TDCR.Page1.Approve_subform.AppComments_1.rawValue == "" ) {

xfa.host.messageBox("Please add comments to the 'Approver Comments' field");

xfa.host.setFocus(TDCR.Page1.Approve_subform.AppComments_1);

}

else {

FSSUBMIT_.execEvent("click");

}

}

}

}

}

else

// other web rendering submit (xfa.host.name not == "Acrobat")

{

if(AWS_SUBMIT_TYPE.rawValue == "PDF")

PDF_SUBMIT.execEvent("click");

else{

FSSUBMIT_.execEvent("click");

}

}

0 Replies