Answered
I would like to set up an importAnFDF() action where the fdf source file has different field names than the receiving file. I want to match the field names of the source file to field names in the receiving form. I tried the following setup but get a null return on field names not present in the target file:
this.importAnFDF()
var afn = this.getField("txt.Atty.FirstName")//field name in source fdf
var bafn = this.getField("txtTPB.Atty.FirstName")//field name in receiving form
bafn.value = afn.value
Is it possible to achieve my objective without the field names from the fdf source being present in the receiving form?
a) when the field exists in the form and in the FDF, the value gets imported.
b) when the field exists in the form, but not in the FDF, nothing happens.
c) when the field does not exist in the form, but exists in the FDF, it gets ignored.
In fact, anything else would not make sense, IMHO.
So, what you want to accomplish is not possible.
You would either convert the FDF to match your fields before you import it (you can use XML handling functions, and stitch together an appropriate XSLT). Or you add matching fields into your form, or you rename your form's fields.
If this scenario occurs frequently with different forms, you might need some management system; I have developed some concepts in that field; feel free to contact me in private.
HTH.