cancel
Showing results for 
Search instead for 
Did you mean: 

ResolveNode() and Extension Fields

former_member183363
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member200995
Contributor
0 Kudos

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

former_member183363
Active Contributor
0 Kudos

Yeah, that's pretty much how I solved it if memory serves --- I forgot to update the question with my findings.

Answers (0)