Guadalupe Barba
04/27/2021, 5:00 PMfunction getURLfromItem(type){
var itemCount = nlapiGetLineItemCount('item');
for (var i=1;i<=itemCount;i++)
{
nlapiSelectLineItem('item', i);
var itemId = nlapiGetCurrentLineItemValue('item','item');
var thumbnailUrl = nlapiLookupField('item',itemId,'custitem84');
var file = nlapiLoadFile(thumbnailUrl);
var imageUrl = file.getURL();
var completeUrl = '<https://system.netsuite.com>' + imageUrl;
nlapiSetCurrentLineItemValue('item', 'custcol_item_thumbnail_url', completeUrl, true, true);
nlapiCommitLineItem('item');
nlapiLogExecution('DEBUG','URL', completeUrl);
}
}
The error occurs when trying to save a new estimate so that the script executes and generates the correct image URL. What am I missing? Please help!battk
04/27/2021, 5:18 PMbattk
04/27/2021, 5:18 PMbattk
04/27/2021, 5:32 PMbattk
04/27/2021, 5:32 PMbattk
04/27/2021, 5:32 PMbattk
04/27/2021, 5:33 PMGuadalupe Barba
04/27/2021, 7:26 PMbattk
04/27/2021, 11:24 PMbattk
04/27/2021, 11:24 PMbattk
04/27/2021, 11:24 PMGuadalupe Barba
04/28/2021, 12:50 PM