Hello;
Yet another problem in which I cannot figure out the right call for the job. I am trying to figure out if this is possible - we have a script that will replace one item with another on server side afterSubmit. The idea is that we can sell 'generic' items or 'alias' items so that we never have to change the website as we change the real inventory item behind the generic item. We want to do this client side, so that a sales rep can just enter in "WIDGETS" and whatever brand of widgets we're selling replaces the line item they just entered.
This is what I have already, being called on validateLine;
var isph = nlapiGetCurrentLineItemValue('item','custcol_placeholder'); var isiph = nlapiGetCurrentLineItemValue('item','custcol_isindividualph'); if (isph == 'T' && isiph == 'T') { var phitem = nlapiGetCurrentLineItemValue('item','custcol_placeholderitemgroup'); var index = nlapiGetCurrentLineItemIndex('item'); alert('New item: ' + phitem); nlapiSetLineItemValue('item','item',index,phitem); nlapiCommitLineItem('item'); }The custom fields are just checkboxes that we have for various levels of controls. What happens is that this just enters an endless loop, obviously its not actually changing the item at all.