12 Replies Latest reply on Jan 8, 2018 11:01 AM by JHoag

    How to resolve Warning JavaScript Window Invalid File Location Error

    JHoag Level 1

      Apologies in advance as I have little JavaScript experience. A JavaScript was created by another coworker who also has little JavaScript experience and propagated to a specific file server folder/share location on our domain network. The script forces users to open PDF documents from this specific location and so prevents users from creating copies of what would be otherwise outdated documents (As was previously the issue). This script also auto time-stamps and closes the document after being printed. All of these JavaScript PDF's are accessed by our domain users via a Microsoft Access database (hyperlinks). These hyperlinks link directly to the file server folders where these JavaScript PDF's are located. This has worked without issue for some time but something has changed. The issue is that something has occurred that now prevents the PDF's with this JavaScript from opening. An error now appears (Warning: JavaScript Window - Invalid File Location). I can see the portion of code causing the prompt and the PDF will open if this portion is removed, however, they want the functionality of it to work as intended. It appears that windows accounts on any domain user computer that were created before this issue surfaced can still open these JavaScript PDF files, however, all newly created Windows accounts on any domain computer for both existing and new users experience the error/issue.  I have pasted the script being used below. I have emboldened the error. I am hoping someone has an idea as to what may be happening.

       

      //-------------------------------------------------------------

      //-----------------Do not edit the XML tags--------------------

      //-------------------------------------------------------------

       

      //<Document-Level>

      //<ACRO_source>load</ACRO_source>

      //<ACRO_script>

      /*********** belongs to: Document-Level:load ***********/

      var allowedPath = "/SERVER/DIRECTORY/FOLDER/";

      if (this.path.indexOf(allowedPath)!=0) {

          app.alert("Invalid file location!");

          this.closeDoc(true);

      }

      //</ACRO_script>

      //</Document-Level>

       

      //<Document-Actions>

      //<ACRO_source>Document Will Print</ACRO_source>

      //<ACRO_script>

      /*********** belongs to: Document-Actions:Document Will Print ***********/

          var f = this.getField("DatePrinted");

          f.hidden = false;

          f.value = "Printed on: " + util.printd("HH:MM dddd, dd mmmm, yyyy", new Date());

          this.dirty = false;

          this.closeDoc(true);

      //</ACRO_script>

      //</Document-Actions>