s
Oups
b
What does your code look like
s
now I'm willing to pay to have this thing fixed
let me put it here in a minute
var itemFulfillment = record.transform({ fromType: record.Type.SALES_ORDER, fromId: id, toType: record.Type.ITEM_FULFILLMENT, isDynamic: true }); var lineCount = itemFulfillment.getLineCount({sublistId: 'item'}); for (var jj = 0; jj < lineCount; jj++) { itemFulfillment.selectLine({sublistId: "item",line: jj}); var vitem = itemFulfillment.getSublistValue({sublistId: 'item',fieldId: 'item',line: jj}) ; if(kk_picked[vitem]&&kk_picked[vitem].balance2>0){ if(kk_picked[vitem].balance2>=vqty){ var qty_picked=vqty; }else{ var qty_picked=kk_picked[vitem].balance2; } kk_picked[vitem].balance2=parseInt(kk_picked[vitem].balance2)-parseInt(qty_picked); } //if(kk_picked[vitem]&&kk_picked[vitem].qty>0){ itemFulfillment.setCurrentSublistValue({sublistId: "item",fieldId: "quantity",value: qty_picked}); itemFulfillment.setCurrentSublistValue({sublistId: "item",fieldId: "custcol_assigned_pick_list",value: vpicklist}); itemFulfillment.setCurrentSublistValue({sublistId: "item",fieldId: "itemreceive",value: false}); itemFulfillment.setCurrentSublistValue({sublistId: "item",fieldId: "itemreceive",value: 'F'}); <--- Should be like this but it's failing itemFulfillment.commitLine({sublistId:"item"}); <--- it fail here } // for (var jj = 0; jj < lineCount; jj++) { itemFulfillment.save({enableSourcing: true,ignoreMandatoryFields: true});
b
why are you setting itemreceive false
s
I would like to set it to 'F'
but it return an error
b
your code always sets itemreceive to false
s
OK
I will remove the line
b
if you do that, you shouldn't be setting any other field
s
let me try
b
itemreceive is the fulfill checkbox in the ui
s
Then I get this
Please configure the inventory detail in line 1 of the item list.
b
marking is false is saying you aren't shipping the item
s
In fact
b
your error is telling you to set the inventory detail subrecord
your item requires either a bin, serial number, or lot number
s
shout....
I'm converting the script from ss1 to ss2
I did not do that second part yet
let me do ut
it