cancel
Showing results for 
Search instead for 
Did you mean: 

Script to get a dataset fieldvalue. (subform is bound to the dataset)

Former Member
0 Kudos

Hi

Hi I am using Adobe print forms in ECC 6.0. This question pertains to scripting (JS or formcalc)

How to access the value of a dataset record field (of an data source.... typical multi row records) where the subform is bound to the dataset.


Data source has the records of structure (say) ABCD. 

ABCD structure has the fields
field1, field2, .......,fieldn
Now the subform (in pdf doc) is bound to
$.ABCD.DATA[*]

How to access value of fieldn without creating a subform field and binding it to fieldn.

In my case fieldn is not to be displayed but its needed to derive another value to be displayed in the pdf.

One option is to define a form field bound to this column and hide the field and then I can access it using form field syntax but what's the other option.

How to access the data source fields through scripting . I have tried the following expressions in the calculate event (of a form field) but none of these worked.


$record.ABCD.fieldn.value
$record.ABCD.data[*].fieldn.value
$record.ABCD.data.fieldn.value
$record.ABCD.fieldn.value

Regards

S Choudhury

Accepted Solutions (0)

Answers (1)

Answers (1)

ashok_dhayalaraj
Explorer
0 Kudos

The script(Formcalc/Javascript) comes into play only when you bind a value to the element on the form. So, the only option is to use the first option that you have mentioned. There is no other way apart from that.

Former Member
0 Kudos

Dear Ashok

Thanks a lot for your time. But the first option is a trivial one. More over what you said is obviously not true as even without binding an element to a data I can use script on that element's event. The two things dont simply have any connection. The idea to define a field element (bound to a dataset columnfield) just to access that dataset field can't just be true. I am just not getting the correct syntax. -


$record.field syntax works fine for header fields(1 record) but for child records probably I am just not getting the correct syntax (involving hierarchy/level p'haps). -


Imagine a scenario where you have 10 dataset columns which are only used to calculate some displayable values then you would have to define 10 form fields and set them to invisible....

Regards

Saurav