These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Adding a form table row from VB via Javascript

cl5792
Registered: Jul 17 2008
Posts: 53

I have this function that was working find when using Acrobat 8 now that I am using Acrobat 9 it is no longer working.

function AddNewRow(sID, sName, sPhone, sAddress, sCity, sState, sZipCode, iRow)
{
var NewRow = this.xfa.resolveNode("Page2.Contacts.Detail").instanceManager.addInstance(iRow);
NewRow.ItemNo.rawValue = iRow;
NewRow.ContactID.rawValue = sID;
NewRow.Name.rawValue = sName;
NewRow.Phone.rawValue = sPhone;
NewRow.Address.rawValue = sAddress;
NewRow.City.rawValue = sCity;
NewRow.State.rawValue = sState;
NewRow.ZipCode.rawValue = sZipCode;
}

The table is on Page2 named Contacts and the row is Detail. the form was created in LiveCycle Designer 8.2.1 I have just upgraded to Acrobat Pro 9.

Do I need to change something in the table on the form or the script? when I run it from VB I get an "Object does not support this property or method" error. I am able to populate individual fields on the form correctly but adding rows and populating a table no longer works. Any help would be greatly and immediately appreciated. I am under a deadline to get this out and it worked previously but now I am stuck!

Thanks,

My Product Information:
Acrobat Pro 9.1.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Did you save the form as Dynamic? The save options changed in Designer 8.1 (i.e. in Acrobat 9). That would explain being able to set values but not being able to add an instance.

Also, have tried running this function from the conosle? How about adding a subform instance from the Console window? Do operations directly from the console is often much faster and gives you more information than doing them from another context.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

cl5792
Registered: Jul 17 2008
Posts: 53
I solved the problem. When I upgraded to Acrobat 9.0 a new local folder (under Documents and Settings) was created for the folder level scripts and I was making changes in the 8.0 folder.

Thanks you for your reply. I had already followed the steps you mentions.