简体   繁体   中英

Access Netsuite xml attribute suitescript

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM