Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

cName Error When Trying to Attach Particular File

Avatar

Level 9

I am using custom buttons to attach, view and remove attachment files to my LiveCycle form. Most files attach without any problem. I have a particular file named, "RECN-TrackingLog.xlsm" that I receive the following error when trying to attach this file to the form. If I copy the file to my desktop, it attaches to the form without any problem. It is named exactly the same. Any idea what is causing this error? I have included the script for the "Attach" button below.

var myDoc = event.target;

var sFile = "myFile"+Math.round(Math.random()*10000000000000);//Randomly generated number

myDoc.importDataObject({cName: sFile});

var myDataObject = myDoc.getDataObject(sFile);

var sFileName = myDataObject.path;

ListBox1.addItem(sFileName,sFile);

NumericField1.rawValue = NumericField1.rawValue + 1;

Picture1.jpg

1 Accepted Solution

Avatar

Correct answer by
Level 9

This error turned out to be caused because someone else had that networked file open at the time I was trying to attach the file. That's why when I dragged and dropped a copy onto my desktop, that "version" of the file was not open and would attach without any problem.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 9

This error turned out to be caused because someone else had that networked file open at the time I was trying to attach the file. That's why when I dragged and dropped a copy onto my desktop, that "version" of the file was not open and would attach without any problem.