5 Replies Latest reply on Dec 19, 2013 11:23 AM by nabnub

    How do we use getDataObjectContents to import fields value from an attachment

    nabnub Level 1

      Hi everyone,


      I am testing this method on how to get a value from an attachment and put it on the current page opened, I've tried to do this: http://cjoint.com/13dc/CLruaj192OV_doc1.pdf


      using the exemple on the AJS reference, but it doesn't work could you please help me to figure out the issue



      var oDoc = this.openDataObject("attachment1");
      try {
      var myField = this.getField("Text");
      // get the value of "MarksTotal1" in PDF attachment
      var yourField = oDoc.getField("MarksTotal");
      // view this value in "Text"
      myField.value = yourField.value;
      } catch(e) { app.alert("Operation failed");}


      tanks a lot