Landed Cost by Line Customization script
# ask-stanley-ai
s
Landed Cost by Line Customization script
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you are looking for a way to customize the Landed Cost by Line in NetSuite. Here are some insights from the threads: 1. If you forget to set "Landed cost per line" on the item receipt and save it, you won't be able to edit and check the box since it's greyed out. A user event script can help you with this issue. 2. You can create a script that looks at data after receipt and creates a landed cost sublist value after the item receipt has been created. Here is a sample code snippet:
Copy code
javascript
var item_receipt = record.load({
	type: 'itemreceipt',
	id: itemReceiptId
});

var existing_sublist = item_receipt.hasSublistSubrecord({
	sublistId: 'item',
	fieldId: 'landedcost',
	line: lineId
});

var existing_landed_cost = item_receipt.getSublistSubrecord({
	sublistId: 'item',
	fieldId: 'landedcost',
	line: lineId
});

existing_landed_cost.setSublistValue({
	sublistId: 'landedcostdata',
	fieldId: 'landedcostcategory',
	value: 1,
	line: lineId
});
3. If you encounter an unexpected error on the landedcostcategory section, it might be because there is no existing landed cost subrecord. You might need to take a step to create a sublist subrecord. 4. The script works in both dynamic and standard mode. If you are using standard mode, you need to ensure your lines and field ids are correct. 5. If you are struggling to find a way to figure out the 'true cost' of an item when landed cost is only recorded on the item receipt, you can create a customization to check the on-hand stock at the beginning of the current period and split the landed cost or ppv to inventory or cogs proportionally. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.847770572
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838071346
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833638251
Please provide your feedback on this answer.