Suitescript 2.0 Inventory Details / Inventory Status

Hi everyone,

Short question:

We have the inventory status feature activated and now Im trying to create an item fulfillment where I have to set the inventory details.

Everything is working fine except to get or to set the value of the item status. The ID of the field should be inventorystatus and it’s on the standard inventory Detail subrecord, right?

Has Someone already tried this?

Code:

var subrec = objRecord.getCurrentSublistSubrecord({ sublistId: ‘item’, fieldId: ‘inventorydetail’ });

subrec.selectNewLine({ sublistId: ‘inventoryassignment’ });

subrec.selectLine({ sublistId: ‘inventoryassignment’, line: 0 });

subrec.setCurrentSublistValue({ sublistId: ‘inventoryassignment’, fieldId: ‘quantity’, value: “1” });

subrec.setCurrentSublistValue({ sublistId: ‘inventoryassignment’, fieldId: ‘binnumber’, value: ‘5153’ });

var invDetStat = subrec.setCurrentSublistValue({ sublistId: ‘inventoryassignment’, fieldId: ‘inventorystatus’, value: “1” });

var getAvail = subrec.getCurrentSublistValue({ sublistId: ‘inventoryassignment’, fieldId: ‘quantityavailable’ });

subrec.commitLine({ sublistId: ‘inventoryassignment’ });

 

Error: You have entered an Invalid Field Value 1 for the following field: inventorystatus”,

Rookie Asked on August 13, 2020 in SuiteScript.
Add Comment
1 Answer(s)

Hey, I would try something like this:

var sublist = 'inventoryassignment';
var subrec = objRecord.getCurrentSublistSubrecord({

sublistId: 'item',

fieldId: 'inventorydetail'

});
subrec.selectNewLine({

sublistId: sublist

});
subrec.setCurrentSublistValue({

sublistId: sublist,

fieldId: 'quantity',

value: 1

});
subrec.setCurrentSublistValue({

sublistId: sublist,

fieldId: 'binnumber',

value: 5153

});
subrec.setCurrentSublistValue({

sublistId: sublist,

fieldId: 'inventorystatus',

value: 1

});
subrec.commitLine({

sublistId: sublist

});
Beginner Answered on September 10, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor