Aria Ghahari
03/25/2020, 2:27 PMfor (i = 1; i <= itemLines; i++){
var itemId = nlapiGetLineItemValue('item','item',i);
nlapiLogExecution('DEBUG','Item ID',itemId);
var itemType = nlapiLookupField('item',itemId,'type');
nlapiLogExecution('DEBUG','Item Type',itemType);
if (itemType != 'Description' || itemType != 'Subtotal'){
nlapiSetLineItemValue('item', 'custcol_pm_customer_requested_date', i, custReqDate);
}
}
Thread in Slack ConversationNElliott
03/25/2020, 2:58 PMNElliott
03/25/2020, 2:59 PMAria Ghahari
03/25/2020, 3:00 PMAria Ghahari
03/25/2020, 3:10 PMfor (i = 1; i <= itemLines; i++)
{
var itemId = nlapiGetLineItemValue('item','item',i);
nlapiLogExecution('DEBUG','Item ID',itemId);
var itemType = nlapiGetLineItemValue('item','itemtpe',i);
nlapiLogExecution('DEBUG','Item Type',itemType);
if (itemType != 'Description' || itemType != 'Subtotal'){
nlapiSetLineItemValue('item', 'custcol_pm_customer_requested_date', i, custReqDate);
}
}
Aria Ghahari
03/25/2020, 3:10 PMNElliott
03/25/2020, 3:13 PMnlapiGetLineItemValue('item','itemtpe',i);
^^ itemtpe maybe you mean itemtype?NElliott
03/25/2020, 3:13 PMAria Ghahari
03/25/2020, 3:14 PMAria Ghahari
03/25/2020, 3:14 PMNElliott
03/25/2020, 3:14 PMAria Ghahari
03/25/2020, 3:15 PMAria Ghahari
03/25/2020, 3:17 PMNElliott
03/25/2020, 3:18 PMAria Ghahari
03/25/2020, 3:19 PMbattk
03/25/2020, 3:21 PMbattk
03/25/2020, 3:21 PMif (itemType != 'Description' || itemType != 'Subtotal'){
nlapiSetLineItemValue('item', 'custcol_pm_customer_requested_date', i, custReqDate);
}
battk
03/25/2020, 3:21 PMAria Ghahari
03/25/2020, 3:21 PMbattk
03/25/2020, 3:23 PM&&
would set the field if the item type is not description and is not subtotalAria Ghahari
03/25/2020, 3:24 PM