Quick ask for some help here: Essentially, I have ...
# general
t
Quick ask for some help here: Essentially, I have an existing fulfillment that needs to get updated based on what actually gets shipped from the warehouse. If non of an item are shipped, I need to mark the checkbox itemreceive aka "Fulfill" as false. I'm doing this via suitescript 2.1. When I mark this field, I get the error "Please configure the inventory detail in line 3 of the item list." I thought perhaps this was an issue with the way I was looping through the lines, but when I tried setting a specific IF explicitly, I still received the same error. Here is the relevant code:
Copy code
childRecord.selectLine({
            sublistId: 'item',
            line: 2
        });
        childRecord.setCurrentSublistValue({
            sublistId: 'item',
            fieldId: 'quantity',
            line: 2,
            value: 9
        });
        var inventoryDetailRecord = childRecord.getCurrentSublistSubrecord({
            sublistId: 'item',
            fieldId: 'inventorydetail',
            line: 2
        });
        inventoryDetailRecord.setCurrentSublistValue({
            sublistId: 'inventoryassignment',
            fieldId: 'quantity',
            line: 2,
            value: 9
        });
        childRecord.commitLine({
            sublistId: 'item',
            line: 2
        });          
           childRecord.selectLine({
                sublistId: 'item',
                line: 3
            });
            childRecord.setCurrentSublistValue({
                sublistId: 'item',
                fieldId: 'itemreceive',
                value: false
            });
            childRecord.commitLine({
                sublistId: 'item',
                line: 3
            });
Is there something else I need to be doing with the inventory detail to allow this to set?
b
you didnt select, nor did you commit the inventory assignment line
👍 1
i recommend removing line parameters when they arent actually used, it makes it more obvious that you are missing line selection
t
@battk thank you! This was the answer!