1
votes

When veiwing any record in Netsuite you can add the following parmameter "&xml=t" to the URL and see th XML data of the record. Sometimes there is data in the xml that is not exposed to any field and I am looking for a way to access it with suitescript but so far I have struck out. Here is an snippet of a vendor credit:

`<line>
<amount>26.10</amount>
<apply>T</apply>
<applydate>1/28/2016</applydate>
<doc>400620</doc>
<due>26.10</due>
<duedate>1/28/2016</duedate>
<internalid>400620</internalid>
<line>0</line>
<pymt>401604</pymt>`

How would I pull the <pymt>401604</pymt> attribute using suitescript as this is the id of a payment record and is not exposed to the UI and I has no internalid.

1

1 Answers

3
votes

That looks like the apply sublist. It's possible the data isn't visible on the form you're using.

Try this:

var rec = nlapiLoadRecord('vendorcredit',recid)
var firstLinePayment = rec.getLineItemValue('apply','pymt',1)

That should give you the transaction id for the record that line applied to.