Hey all... has anyone scripted anything for Landed...
# suitescript
t
Hey all... has anyone scripted anything for Landed Cost? Specifically, an item receipt has already been created (with "Landed Cost Per Line" already checked). I am creating a script that looks at data after receipt and is looking to created a landed cost sublist value after the IR has been created.
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
});
I get an unexpected error on the landedcostcategory section
There is no existing landed cost subrecord... is there a step I need to take? I know there was a function back in SS1.0 that was something like "Create Sublist Subrecord" or something
b
t
So this only works in Dynamic mode?
I swapped to dynamic mode and that seemed to have worked. But still, is there no way to make this work w/o dynamic?
b
it works in standard mode
you would just need to get your lines correct
and the field ids correct
👍 1