on 06-06-2017 9:30 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.