Hey Everyone :saluting_face: When i tried to upda...
# suitescript
d
Hey Everyone 🫡 When i tried to update the existing Invoice i got this error : Please configure inventory details How i update the existing invoice 1. Look for the invoice using : Etail order id 2. search for line item inside items using SKU 3. inside that item i want to update Etail order line ID SCRIPT
Copy code
function updateme() {
    r = nlapiLoadRecord("invoice", 246059, {"recordmode":"dynamic"});
    r.selectLineItem("item", 1);
    r.setCurrentLineItemValue("item", "item", 26492);
    r.setCurrentLineItemValue("item", "custcol_celigo_etail_order_line_id", "45019547993346");
    r.setCurrentLineItemValue("item", "line", "1");
    r.setCurrentLineItemValue("item", "id", "246059_1");
    r.commitLineItem("item");
}
How to ignore inventory details because i can do it in UI Thanks in advance 🫡
b
dont change the item, that will reset all sourced fields
quit trying to mess with the internal line and id fields
d
@battk yes but i don't know how to stop it from trying to add the same item when it's trying to update it
this script is created by celigo
@battk function updateme() { r = nlapiLoadRecord("invoice", 246059, {"recordmode":"dynamic"}); r.selectLineItem("item", 1); r.setCurrentLineItemValue("item", "item", 26492); ======> This part r.setCurrentLineItemValue("item", "custcol_celigo_etail_order_line_id", "45019547993346"); r.setCurrentLineItemValue("item", "line", "1"); r.setCurrentLineItemValue("item", "id", "246059_1"); r.commitLineItem("item"); }
b
remove lines from the code that doesnt do what you want it to do
if you dont know which ones those are, then dont touch it and get celigo to fix the problem
d
@battk i see thank you so much