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

[object Field] returned instead of data

David Dunn
Registered: Oct 28 2010
Posts: 116
Answered

I am creating reports with the new Report() function. I added 3 variables referencing 3 fields in the same fashion as several others in my report, and when I generate the report it returns [object Field] where my data should appear for these 3 fields. The rest of fields turn out just fine.
 
My problem variables and their employment are:
 
var firmName = this.getField("txtTPS.Atty.FirmName")
var attyContact = this.getField("txtTPS.Atty.ContactPerson")
var attyContactEmail = this.getField("txtTPS.Atty.ContactE-mail")
 
rpt.writeText("From: " +firmName)
rpt.writeText("Contact person: " +attyContact)
rpt.writeText("E-mail: " +attyContactEmail)
 
These 3 fields in the report generate like this:
 
From: [object Field]
Contact person: [object Field]
E-mail: [object Field]
 
Would appreciate it if someone could tell me why I get [object Field] instead of the data that is in these 3 fields.
 
Thank you.
 
David

David D

My Product Information:
Acrobat Pro 9.4, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Accepted Answer
You have to get the field values:

var firmName = getField("txtTPS.Atty.FirmName").valueAsString;