suitescript set custom column value netsuite
<p>Using Pick, Pack and Ship and advanced PDF HTML templates, NetSuite cannot display the qty remaining to pick.  So if we do a partial pick, we cannot show the warehouse the remaining balance. The math is simple, here is the script and function I would like to see (based on forum feedback).  Will this work and what is the best way to deploy this script such that the result is stored in the custom column until another pick takes place?  The value is to be calculated at time of changes, but available to all related transaction records. </p>

<pre><code>function SetQtytoPick(type){
  if(type == 'item'){
    var qtyordered = nlapiGetCurrentLineItemValue('item', 'quantity');
    var qtypicked = nlapiGetCurrentLineItemValue('item', 'quantitypicked');
    var qtytopick = qtyordered-qtypicked
    nlapiSetCurrentLineItemValue('item', 'custcol_qty_to_pick', qtytopick);
  }
}
</code></pre>