4 Replies Latest reply on Sep 2, 2012 5:41 PM by vJnr

    Assistant required - Notallowederror: security settings prevent access to this property or method

    vJnr

      Hey guys

       

      Another Notallowederror quesiton, can you please assist? I'm very new to LiveCycle and coding in general, any assistant would greatly be appreciated.

       

      Within my form there's an 'Add attachement question', the following message pop up when the button is clicked

       

      Acrobat EScript Built-in Functions Version 10.0

      Acrobat SOAP 10.0

       

      NotAllowedError: Security settings prevent access to this property or method.

      Doc.importDataObject:13:XFA:Form[0]:supportingDocs_pg[0]:supportingDocs2_sf[0]:smallAttach s_sf[0]:BtnAdd[0]:click

       

      Form.supportingDocs_pg.supportingDocs2_sf.smallAttachs_sf.BtnAdd::click - (JavaScript, client)

       

      // Attach File

      var lodoc = event.target;
      var loattachs = lodoc.dataObjects;
      var lvattachsnum = 0;

           if (loattachs != null)
           {
                lvattachsnum = loattachs.length;
           }


      var lv_aname = "attach" + (lvattachsnum + 1); lodoc.importDataObject(lv_aname); var loattach = lodoc.getDataObject(lv_aname);


      var fileName = loattach.path;     // Check for file extension


      var FileExt = fileName.substring(fileName.lastIndexOf(".")).toUpperCase();


      var max_size = 2097152; //2mb      var size = loattach.size;

      //xfa.host.messageBox("size"+size);

            if (size > max_size)
            {
                   xfa.host.messageBox("Use the large attachment option. Attachment larger than 2MB cannot be attached in this window. ");
                   lodoc.removeDataObject(lv_aname);
            }

       

           else if (FileExt == null ||
                     FileExt == "" || (
                     FileExt != ".AVI" &&
                     FileExt != ".BMP" &&
                     FileExt != ".BPMN" &&
                     FileExt != ".DOC" &&
                     FileExt != ".DOT" &&
                     FileExt != ".DOCX" &&
                     FileExt != ".DOTX" &&
                     FileExt != ".DRW" &&
                     FileExt != ".EML" &&
                     FileExt != ".EPS" &&
                     FileExt != ".GIF" &&
                     FileExt != ".JPG" &&
                     FileExt != ".MP3" &&
                     FileExt != ".MP4" &&
                     FileExt != ".MPEG" &&
                     FileExt != ".MPG" &&
                     FileExt != ".MPP" &&
                     FileExt != ".MSG" &&
                     FileExt != ".NOTEBOOK" &&
                     FileExt != ".ODT" &&
                     FileExt != ".OTT" &&
                     FileExt != ".SXW" &&
                     FileExt != ".STW" &&
                     FileExt != ".PDF" &&
                     FileExt != ".XDP" &&
                     FileExt != ".CP" &&
                     FileExt != ".PNG" &&
                     FileExt != ".PPT" &&
                     FileExt != ".POT" &&
                     FileExt != ".PPTX" &&
                     FileExt != ".POTX" &&
                     FileExt != ".PUB" &&
                     FileExt != ".RTF" &&
                     FileExt != ".TIF" &&
                     FileExt != ".TIFF" &&
                     FileExt != ".TXT" &&
                     FileExt != ".URL" &&
                     FileExt != ".VSD" &&
                     FileExt != ".WAV" &&
                     FileExt != ".WMA" &&
                     FileExt != ".WMV" &&
                     FileExt != ".XLS" &&
                     FileExt != ".XLT" &&
                     FileExt != ".XLSX" &&
                     FileExt != ".XLTX"))
           {
                    var lvmsg = "Attachments of this type are not accepted. File Type:" + FileExt;
                    app.alert(lvmsg);
                    lodoc.removeDataObject(lv_aname);
           }


         else
         {
                var fileName2 = loattach.path;

                xfa.form.Form.supportingDocs_pg.supportingDocs2_sf.smallAttachs_sf.ListBox1.addItem(fileN ame2, lv_aname);         

          }

       

      Thanks guys

      Van