This message was deleted.
# ask-stanley-ai
s
This message was deleted.
c
AI generated answer (using internal Slack threads):
To get the quantity of items with lot number ending with 24, you can modify the existing SuiteScript code provided in the conversation. The modification would involve adding a condition to check if the lot number ends with 24 before processing the quantity. Here is a modified version of the code:
Copy code
javascript
inventoryitemSearchObj.run().each(function (result) {
  var lotNumber = result.getValue({
    name: "internalid",
    join: "inventoryNumber",
  });

  // Check if lot number ends with 24
  if (lotNumber.endsWith('24')) {
    var quantity = result.getValue({
      name: "quantityavailable",
      join: "inventoryNumber",
    });
    var qtysubmit = Math.min(quantitycommitted, quantity);

    var subList = fulfillmentRecord.getSublistSubrecord({
      sublistId: "item",
      fieldId: "inventorydetail",
      line: i,
    });
    subList.setSublistValue({
      sublistId: "inventoryassignment",
      fieldId: "quantity",
      line: 0,
      value: qtysubmit,
    });
    subList.setSublistValue({
      sublistId: "inventoryassignment",
      fieldId: "issueinventorynumber",
      line: 0,
      value: lotNumber,
    });
  }
  return true;
});
This code will only process the items whose lot number ends with 24. Please note that this code assumes that you have a variable
quantitycommitted
and
i
defined in your script. Also, the
endsWith
function is used to check if the lot number ends with 24. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.801059783
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.792181969
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.790396273
Please provide your feedback on this answer.