This topic contains 3 replies, has 2 voices, and was last updated by Akram Ebeid 4 years, 7 months ago.

  • Author
    Posts
  • #1537 Score: 0

    johnsongilpp
    • Contributions: 0
    • Level 1

    Hi,

    Has anyone had to create a script and add multiple bins with their quantity to a bin put away worksheet? I can’t find any resources on how to add the multiple bins with their quantity. I’m currently doing it as a sub record but it’s throwing errors. Please see the code below. The part I can’t get working is adding the bin and it’s quantity.

    for (var b = 0; b < itemBins.length; b++) { log.debug('itemBins', itemBins[b]); var item_bin_de = itemBins[b].split(":"); log.debug('item_bin_de name', item_bin_de[0]); log.debug('item_bin_de qty', item_bin_de[1]); subrecordInvDetail = inventory_adjustment.getCurrentSublistSubrecord({ sublistId: 'item', fieldId: 'inventorydetail' }); subrecordInvDetail.selectNewLine({ sublistId: 'inventoryassignment' }); subrecordInvDetail.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'quantity', value: item_bin_de[1] }); subrecordInvDetail.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'binnumber', value: item_bin_de[0] }); subrecordInvDetail.commitLine({ sublistId: 'inventoryassignment' }); } inventory_adjustment.commitLineItem('item'); }
    This is a cached copy. Click here to see the original post.

  • #1538 Score: 0

    fjannelle
    • Contributions: 0
    • Level 1

    Good morning,

    What error(s) are you getting?

    One possibility is that your record is not in dynamic mode which prevents usage of .getCurrentSublistSubrecord() and .selectNewLine(). If I remember right the error code in this case is INVALID_API_USAGE.

    If that is the case you would need to use .insertLine() and .getSubrecord() instead.

    Best regards,

  • #1539 Score: 0

    johnsongilpp
    • Contributions: 0
    • Level 1

    Hi fjannelle, Thanks for the response. One issue I found was that we aren’t using advanced inventory/ BINs so the sub record method of setting the bins and quantity won’t work. I read something that stated i needed to format the value as a string and pass it but that also is not working. The format I’m using is A10703-H(400)CUT4(400)Receiving-Bin-1(5)H31301(0) when the final string is finished.

  • #26120 Score: 0

    Akram Ebeid
    Member
    • Contributions: 1
    • Level 1
    @akram_ebeid

    Hi I’m a new user to Netsuite and I want to change bin status for more than 2500 items in Bin Putaway Worksheet . Is there any solution for this issue, I mean by mass update or script instead of changing it individually.

    Thanks in advance

You must be logged in to reply to this topic.