Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

dataObjects property doesn't work properly


Level 3


a Thank to everyone that take their time to give me answer to my questions especially to Bruce.

I have a litle problem. I want check if there are some attachments files on my form then i want gire their name if no i just want to hidde the field.

I saw some exmaples on internet with dataObjects. but when i use it on my script it send me this error.  ->

Script failed (language is javascript; context is xfa[0].form[0].Benteler3DMaster[0].TOC[0].attachedFilesName[0])

script = var myDoc = event.target;

var attachments = myDoc.dataObjects;

if (attachments !== null) {

this.rawValue = "not files found";

} else {

this.rawValue = "there are some files";


Error: Invalid property get operation; field doesn't have property 'dataObjects'

i use Designer aem 6.3 form.




3 Replies


Level 10

Hi Arthur,

What event is this script running in, the calculate event?  It looks ok to me syntactical , but haven't you the condition

if (attachments !== null) {

around the wrong way, look like it should be

if (attachments === null) {

You should get a line number in the error message, have you dropped that off when pasting into the forum?



Level 3

yes i run it in the calculate event on the server side.

there is thre error message ->  Error: Invalid property get operation; field doesn't have property 'dataObjects'.

when i initialize a variable like var doc = event.target; i dont receive any error , but when i add dataObjects i receive an error like  Error: Invalid property get operation; field doesn't have property 'dataObjects'

i changed the if statement but i receive the same error.



Level 10


Probably can't help with any server side questions, I haven't done much and haven't an environment to test with.

But, your error does seem strange, like you have a field object called myDoc which is confusing the JavaScript engine. Is that possible?

Also there should be a line or two before that message which gives the context of the error, something like;


Maybe a screen shot will help.