Adding an Attachment Description on JavaScript Attachment Import (importDataObject) in Adobe LiveCycle ES/Acrobat.

With Adobe LiveCycle ES...

I'm using the (working) JavaScript code (referenced below) in a button in Adobe LiveCycle ES to import an attachment. However, I want to attachment description to match the name of the button used to import it.

How can I add an Attachment Description to an attachment when I import it?
form1.#subform[0].Att_MBH::click - (JavaScript, client)

var AttachmentDescription = this.name;
AttachmentDescription.rawValue = "New Attachment" + AttachmentDescription.rawValue; 
var strAttachmentName = AttachmentDescription.rawValue; 
var myDoc = event.target; 
myDoc.importDataObject(strAttachmentName); 
var objDoc = myDoc.getDataObject(strAttachmentName); 
var FileName = "";
FileName.rawValue = objDoc.path; 
//this.presence = "invisible"; 
AttachmentDescription.access = "protected";

Open in new window

LVL 1
travisjbennettAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Karl Heinz KremerCommented:
After you get the data object (myDoc.getDataObject) you can access the description like this:

objDoc.description = "some description";

However, I don't think that how you determine the description value is not working: In line #3 you are getting the name of the button. This is a string. In the following line you are trying to get the rawValue, which is only valid for a form field, not a string. Do you want to do something like this?

var AttachmentDescription = "New Attachment " + this.name;

The same is true for what you do with FileName in line #10 - you don't have to use RawValue, it's only for fields.
I don't know what you want to do in line #12. This is also not working correctly.

Do you have experience with JavaScript in general, and Acrobat JavaScript specifically?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
travisjbennettAuthor Commented:
No, I'm a VBA/Fortran/C guy. I was assuming RawValue was the same as a .Value in VBA.

I'll look into it more and get back to you soon, but this is a big head start. Thanks!
James MurrellProduct SpecialistCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Acrobat

From novice to tech pro — start learning today.