UNPKG

nsmockup

Version:

Test your Suitescripts before deploying to NetSuite

26 lines (21 loc) 621 B
'use strict'; var $metadata = require('../../db-utils/metadata'), $sublist = require('../../ctx-utils/sublist'); exports.$$hook = true; exports.nlapiGetCurrentLineItemIndex = (ctx) => { /** * Return the line number for the currently selected line. * * @param {string} type sublist name * @return {int} * * @since 2005.0 */ return (type) => { let $this = ctx.$$THIS_RECORD || {}, recType = $this.recordType; $metadata.existsSubList(recType, type); let subList = $sublist.get($this, type); return subList.index || -1; }; };