• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

exportAsFDF: values exported from fields not in the array

Engaged ,
Feb 12, 2018 Feb 12, 2018

Copy link to clipboard

Copied

I have the following in a folder level script in a privileged context:

this.exportAsFDF({aFields: ["txtTP.Agent.Broker", "txtTP.Agent.BrokerFullName", "txtTP.Agent.Address", "txtTP.Agent.City", "txtTP.Agent.State", "txtTP.Agent.Zip", "txtTP.Agent.BrokerNo"], cPath: "" + parentPath + agentsFolder + fdfbroker});

This works as intended EXCEPT that it is exporting values from several other fields ( examples: "txtTP.Agent.FirstName", "txtTP.Agent.LastName") that are not included in the intended array. These other fields do have the same non-terminal parent "txtTP.Agent" but my understanding is that the array should limit the export to only the named fields.

I can work-around this by first resetting the excluded fields, but that shouldn't be necessary. I cannot see that a parameter is missing whose absence is causing these other fields to be included, and would appreciate any advice to correct this.

Thank you.

TOPICS
Acrobat SDK and JavaScript

Views

396

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 12, 2018 Feb 12, 2018

Copy link to clipboard

Copied

That's probably because of your naming scheme. The period notation is

reserved for declaring groups of fields. It's most likely considering those

fields as members of "txtTP.Agent", and therefore exports all of them.

On 13 February 2018 at 00:10, ddunn@davidsdunn.com <forums_noreply@adobe.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 13, 2018 Feb 13, 2018

Copy link to clipboard

Copied

Although I recognize that you are probably correct I am reluctant and perhaps unqualified to say so, but in my limited experience it seems to me the evidence is otherwise.

in the API Reference a comment accompanies the aFields parameter for exportAsFDF. That comment says "Specify non-terminal field names to export an entire subtree of fields (see the example below)." Using a non-terminal field is therefore a shortcut to exporting all child fields and values of that parent. The corollary to using the non-terminal shortcut is to go to the trouble of specifying an array limiting the export to specific fields.

Every discussion of the word "array" throughout the API is accompanied by the word "specifics." The objective of arrays is precision. In the context of exportAsFDF then, an array of fields ought to limit the export to only the named fields, regardless of whether they are part of a larger family. This leads me to believe that the inclusion of all omitted child fields with an array of specific fields in the same family is a program defect that needs to be fixed. For example, you won't get that result in the context of calculated values of numeric child fields.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 13, 2018 Feb 13, 2018

Copy link to clipboard

Copied

I agree that it shouldn't work like that. I was just trying to guess why it might. Neither you nor I know the insides of this function, after all... You can always report it to Adobe as a bug: Feature Request/Bug Report Form

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 13, 2018 Feb 13, 2018

Copy link to clipboard

Copied

LATEST

Thank you. I will do that. As an afterthought in support of what I said - which I will use in making a bug report - if you specify an array of  fields with this.resetForm(fields), the reset action will not operate on every child field with the same non-terminal naming convention.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines