Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new

Learn more

View all

Sign in to view all badges

Insert PDF Attachment, Open Attachment and Remove Attachment issues. Please help

Level 2
Level 2

Hello all,

I'm in the middle of creating a very complex pdf form via LC and have run into a couple of roadblocks. On page 5, I need the user to be able to attach a document "Add Profile", they then need to be able to open the attachment "View Profile" and remove the document if needed "Remove Profile. My Add Profile button works great but the View and Remove can't locate the file attachment.

Here is a link to my working document:

Here is a link to the document I am using as a code reference:

My button scripts are Below:

form1.Successor_Summary.Table2.Row1.Table3[1].Row1.Cell1.Add_Profile::click - (JavaScript, client)

var myDoc =;

var sFile = "myFile".rawValue;

myDoc.importDataObject({cName: sFile});

var myDataObject = myDoc.getDataObject(sFile);

var sFileName = myDataObject.path;

Profile_Name.rawValue= sFileName,sFile;

form1.Successor_Summary.Table2.Row1.Table3[1].Row1.Cell1.Remove_Profile::click - (JavaScript, client)


var myDoc =;

var sFile = ProfileName.rawValue;



ProfileName.rawValue= "";


var myRemoveObject =;

var a = myRemoveObject.getField("form1.Successor_Summary.Table2.Row1.Table3.Row1.Cell1.ProfileName");

a.deleteItemAt(); // delete current item, and...

a.currentValueIndices = 0;




app.alert("Error in removing document");



form1.Successor_Summary.Table2.Row1.Table3[1].Row1.Cell1.ViewProfile.View_Profile::click - (JavaScript, client)


var myDoc =;

var sFile = Profile_Name.rawValue;

myDoc.exportDataObject({ cName: sFile, nLaunch: 2 });




app.alert("There are no files to open");


0 Replies