Skip to Content

ResolveNode() and Extension Fields

Hi,

I have some extension fields at item level on the PO form schema. The path of one of them is as follows:

$record.PurchaseOrder.Item[*].ShipfromFactoryAddressLine1_B8QSCF1URRGR72R3018E4N2O2

I've got a script on a subform on a customised PO in LiveCycle:

var firstItem = xfa.resolveNode("record.PurchaseOrder.Item[0]");
this.txtFactoryAddress1.rawValue = firstItem.ShipfromFactoryAddressLine1_B8QSCF1URRGR72R3018E4N2O2.value;

But the report window tells me:

Error: Invalid property get operation; dataGroup doesn't have property 'ShipfromFactoryAddressLine1_B8QSCF1URRGR72R3018E4N2O2'

I get the same if I remove the '.value' bit from the assignment. How then to correctly refer to extension fields using resolveNode etc.?

The use case is that we have some item-level extension fields, but in this case want them to appear at header level, hence why I'm not just putting them in the item table, so I'm trying to retrieve the first item and gets its values, then assign them to some text fields.

Lewis

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Feb 28 at 02:14 AM

    Hi Lewis,

    We can try get all item, and loop the first item, sample code(not complete):

    var firstItem = xfa.resolveNodes("record.PurchaseOrder.Item[*]");
    
    for(var j=0; j< firstItem.length; j++)
    {
        var tmp = firstItem.item(j).resolveNode("ShipfromFactoryAddressLine1_B8QSCF1URRGR72R3018E4N2O2");
        if(tmp != null)
        {
            this.txtFactoryAddress1.rawValue = firstItem.item(j).ShipfromFactoryAddressLine1_B8QSCF1URRGR72R3018E4N2O2.value;
        }
        break;           
    }

    Another way: If the same value for all items, we can put them in the item table, and choose anyone to fill.

    Best Regards,

    Benny Huang

    Add comment
    10|10000 characters needed characters exceeded