Highlighted

File Attachment Issue

LaneP

10-07-2019

I am having an issue with file attachment script.  If several files are attached (3+) and removed, they can no longer be opened.  Also, the actual attachments are not being capture in the list on the form properly.

Thanks for your assistance.

Attachment Fail.JPG

Replies

Highlighted

LaneP

10-07-2019

form1.page1.Block13.FileAttachments.attachmentsList::ready:layout - (JavaScript, client)

if( attachmentsList.length != 0){

    this.caption.value.resolveNode("#text").value = "       List of Attachments ["+attachmentsList.length+"] (All Files Must be Attached Prior to Signing, i.e., for any digital signature on the form)";

}

else{

    this.caption.value.resolveNode("#text").value = "       List of Attachments (All Files Must be Attached Prior to Signing, i.e., for any digital signature on the form)";

}

form1.page1.Block13.FileAttachments.AddAttachment::click - (JavaScript, client)

var oObj = event.target;

var fileAttachments = oObj.dataObjects;

if( fileAttachments == null){

    if (oObj.importDataObject(0) != false){

        var oDataObj = oObj.getDataObject(0);

        attachmentsList.addItem(oDataObj.path);   

    }

}

else if( fileAttachments != null){

    if (oObj.importDataObject(fileAttachments.length) != false){

        var oDataObj = oObj.getDataObject(fileAttachments.length);

        attachmentsList.addItem(oDataObj.path);

   

    }

}

else{    app.alert("Error processing this request.");}

form1.page1.Block13.FileAttachments.ViewAttachment::click - (JavaScript, client)

var oObj = event.target;

var sAttachObjName = attachmentsList.selectedIndex;

if (sAttachObjName != -1){

    oObj.exportDataObject({ cName: sAttachObjName, nLaunch: 2 });

}

form1.page1.Block13.FileAttachments.RemoveAttachment::click - (JavaScript, client)

var oObj = event.target;

oObj.removeDataObject(attachmentsList.selectedIndex);

attachmentsList.deleteItem(attachmentsList.selectedIndex);

Highlighted
Highlighted

LaneP

19-07-2019

Mayank,

Did you have luck with the issue?  I have determined the feature will only work for a couple attachments that are added or removed a minimal number of times.

Highlighted

Mayank_Gandhi

Employee

19-07-2019

I am unable to catch hold of the issue but the problem is even if you have two files also. The files are unable to open once you have clicked on remove attachment after selecting a file. It's like the list still has the name but the value of attachment in null.