Minimum order quantity is disabled
# ask-stanley-ai
h
Minimum order quantity is disabled
c
AI generated answer (using internal Slack threads):
Based on the conversations, it appears that there is no native field in NetSuite to set a minimum order quantity (MOQ) for purchasing per vendor on an item. However, you can use the "Order Multiples" field as a workaround, although it's not an exact match for MOQ. As for restricting changes to the Sales Order line item if it has already been invoiced, you can use a User Event Script. Here is a sample script provided in the conversation:
Copy code
javascript
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @Author Jack Arens | National Food Group
 */
define(['N/ui/serverWidget'],
    function(serverWidget) {
        function beforeLoad(scriptContext) {
            var record = scriptContext.newRecord;
            var status = record.getValue('statusRef');

            if(status === 'fullyBilled'){
                scriptContext.form.getSublist('item').getField('quantity').updateDisplayType({displayType: serverWidget.FieldDisplayType.DISABLED});
            }
        }
        return {
            beforeLoad: beforeLoad
        };
    });
This script disables the 'quantity' field if the status of the record is 'fullyBilled'. It is suggested to also lock the 'rate' and 'amount' fields. The script should be deployed to the restricted roles. ****** 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.838432729
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8288275
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816885114
Please provide your feedback on this answer.