hi guys! I am working on a MR script that is suppo...
# suitescript
k
hi guys! I am working on a MR script that is supposed to transform SO into IFF, it looks like the script is working as desired for all the Items except lot numbered items. While populating the inventory details for lot numbered items, the script keeps on throwing this error:
USER_ERROR","message":"Please enter value(s) for: Status
I think the part of the script where it is breaking is here:
Copy code
inventory_detail_rec.setSublistValue({
                                                sublistId: 'inventoryassignment',
                                                fieldId: 'issueinventorynumber',
                                                value: lotNumber,
                                                line: 0
                                            });
    
                                            if (lotQtyAvail >= itemQtyRemaining) {
                                                inventory_detail_rec.setSublistValue({
                                                    sublistId: 'inventoryassignment',
                                                    fieldId: 'quantity',
                                                    line: 0,
                                                    value: itemQtyRemaining
                                                });
                                            }
                                            else{
                                                inventory_detail_rec.setSublistValue({
                                                    sublistId: 'inventoryassignment',
                                                    fieldId: 'quantity',
                                                    line: 0,
                                                    value: lotQtyAvail
                                                });
                                            }
    
                                            inventory_detail_rec.setSublistValue({
                                                sublistId: 'inventoryassignment',
                                                fieldId: 'inventorystatus',
                                                line: 0,
                                                value: invDtlStatusDef
                                            });
does anyone know what is wrong with this?
b
code looks fine
Copy code
var inventoryDetail = itemFulfillment.getSublistSubrecord({
    sublistId: "item",
    fieldId: "inventorydetail",
    line: 0,
  });
  inventoryDetail.setSublistValue({
    sublistId: "inventoryassignment",
    fieldId: "issueinventorynumber",
    value: "120",
    line: 0,
  });
  inventoryDetail.setSublistValue({
    sublistId: "inventoryassignment",
    fieldId: "quantity",
    value: 5,
    line: 0,
  });
  inventoryDetail.setSublistValue({
    sublistId: "inventoryassignment",
    fieldId: "inventorystatus",
    value: "2",
    line: 0,
  });
will correctly setup an inventory detail
assuming your ids are correct and the quantities involved are correct
k
Thank you @battk! It looks like the lot numbered item that I was using had some issues. Other lot numbered item are transformed correctly.