This topic contains 1 reply, has 0 voices, and was last updated by gourisankar 6 years, 4 months ago.
-
AuthorPosts
-
June 22, 2018 at 1:21 am #21944
kyriakos@e-litt.euHello everyone,
I want a script that when an item receipt comes from a third system to netsuite to basically go in every line of the items that are there and enable the calculate est. landed costs checkbox. Basically what I do from the UI.
I have created a BS event, iterate all lines and tried change values to the following 'landedcostset', 'tracklandedcost' but whatever changes I make here its like another script reverts those.
I also tried to get value of 'custcol_scm_lc_autocalc' which I found from saved search but this returns null.
Has anyone approached this differently or can explain me how landed costs are calculated before saved?
This is a cached copy. Click here to see the original post. -
June 27, 2018 at 4:19 am #21945
gourisankarHi ,
Got this code from help center. Thought it would help
/ Creating a landed cost subrecord
var purchaseOrder = nlapiCreateRecord('purchaseorder');
purchaseOrder.setFieldText('entity', 'Acme Medical Supply');
purchaseOrder.setLineItemValue('item', 'item', 1, inventoryItemId);
var purchaseOrderId = nlapiSubmitRecord(purchaseOrder);
var itemReceipt = nlapiTransformRecord('purchaseorder', purchaseOrderId, 'itemreceipt');
itemReceipt.selectLineItem('item', 1);
itemReceipt.setCurrentLineItemValue('item', 'location', 1);
itemReceipt.setFieldValue('landedcostperline', 'T');
var landedCost = itemReceipt.createCurrentLineItemSubrecord('item', 'landedcost');
landedCost.selectNewLineItem('landedcostdata');
landedCost.setCurrentLineItemValue('landedcostdata ', 'costcategory', 1);
landedCost.setCurrentLineItemValue('landedcostdata ', 'amount', 456);
landedCost.commitLineItem('landedcostdata');
landedCost.selectNewLineItem('landedcostdata');
landedCost.setCurrentLineItemValue('landedcostdata ', 'costcategory', 3);
landedCost.setCurrentLineItemValue('landedcostdata ', 'amount', 78.96);
landedCost.commitLineItem('landedcostdata');
landedCost.commit();
itemReceipt.commitLineItem('item');
var itemReceiptId = nlapiSubmitRecord(itemReceipt);
-
AuthorPosts
You must be logged in to reply to this topic.