Pick Strategy

A pick strategy record contains filters that can be applied to the backend process that determines the preferred bin for items in a pick task record. When a wave transaction is saved or released, the backend process uses any available pick strategies to sort bins based on pick strategy filters.

The pick strategy record is available when the Warehouse Management feature is enabled. For help working with this record in the UI, see Defining Pick Strategies.

The internal ID for this record is pickstrategy.

See the SuiteScript Records Browser for all internal IDs associated with this record.

Note:

For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.

For information about scripting with this record in SuiteScript, see the following help topics:

Supported Script Types

The pick strategy record is scriptable in both client and server SuiteScript.

Supported Functions

The pick strategy is fully scriptable — it can be created, copied, updated, deleted, and searched using SuiteScript.

Usage Notes

See the Fields section for more details about working with this record.

Fields

Note the following usage notes for specific fields on this record:

  • The Customer field is enabled only for the Sales Order transaction type.

  • If the Inventory Status feature is enabled on the account, the Inventory Status field is displayed, containing all inventory status records in the dropdown list.

  • The Location dropdown list shows only the location records that have the Use Warehouse Management box checked.

Code Samples

The following sample code in SuiteScript 2.0 includes creating and editing a pick strategy record.

            require(["N/record"], function (record) {
    function createPickStrategy() {
        var locationId = 1;

        var pickStrategy = record.create({type: record.Type.PICK_STRATEGY, isDynamic: true});
        pickStrategy.setValue({fieldId: "name", value: "General strategy"});
        pickStrategy.setValue({fieldId: "description", value: "This will be used if no other strategy is applied"});
        pickStrategy.setValue({fieldId: "priority", value: 1000000000});
        pickStrategy.setValue({fieldId: "trantype", value: "TrnfrOrd"});
        pickStrategy.setValue({fieldId: "location", value: locationId});

        addZoneLine(pickStrategy, {sequence: 100, zoneId: 1});
        addZoneLine(pickStrategy, {sequence: 200, zoneId: 2});
        addZoneLine(pickStrategy, {sequence: 300, zoneId: 3});

        setTranslationValues(pickStrategy, {languageName: "Czech", name: "Obecná strategie", description: "Bude použita, pokud nebyla aplikována žádná jiná strategie"});

        pickStrategy.save();
    }

    function editPickStrategy() {
        var pickStrategyId = 8;
        var locationId = 10;
        var itemProcessfamilyId = 3;
        var itemProcessGroupId = 10;
        var itemId = 267;
        var unitId = 1;
        var INVENTORY_CLASSIFICATION_B = 2;
        var orderTypeId = 2;
        var customerId = 14;
        var INVENTORY_STATUS_ALL_AVAILABLE = -1;

        var pickStrategy = record.load({type: record.Type.PICK_STRATEGY, id: pickStrategyId, isDynamic: true});
        pickStrategy.setValue({fieldId: "name", value: "Specific strategy"});
        pickStrategy.setValue({fieldId: "description", value: "This will be used when all the criteria match the Pick Task"});
        pickStrategy.setValue({fieldId: "priority", value: 1});
        pickStrategy.setValue({fieldId: "trantype", value: "SalesOrd"});
        pickStrategy.setValue({fieldId: "location", value: locationId});
        pickStrategy.setValue({fieldId: "itemprocessfamily", value: itemProcessfamilyId});
        pickStrategy.setValue({fieldId: "itemprocessgroup", value: itemProcessGroupId});
        pickStrategy.setValue({fieldId: "item", value: itemId});
        pickStrategy.setValue({fieldId: "units", value: unitId});
        pickStrategy.setValue({fieldId: "invtclassification", value: INVENTORY_CLASSIFICATION_B});
        pickStrategy.setValue({fieldId: "ordertype", value: orderTypeId});
        pickStrategy.setValue({fieldId: "customer", value: customerId});
        pickStrategy.setValue({fieldId: "inventorystatus", value: INVENTORY_STATUS_ALL_AVAILABLE});
        pickStrategy.setValue({fieldId: "includeinboundstagingbins", value: true});

        editZoneLine(pickStrategy, {line: 0, sequence: 10, zoneId: 12});
        editZoneLine(pickStrategy, {line: 1, sequence: 20, zoneId: 13});
        editZoneLine(pickStrategy, {line: 2, sequence: 30, zoneId: 14});

        setTranslationValues(pickStrategy, {languageName: "Czech", name: "Konkrétní strategie", description: "Bude použita, pokud všechna kritéria odpovídají úloze vychystání"});

        pickStrategy.save();
    }

    function addZoneLine(pickStrategy, zoneLine) {
        pickStrategy.selectNewLine({sublistId: "zones"});
        pickStrategy.setCurrentSublistValue({sublistId: "zones", fieldId: "priority", value: zoneLine.sequence});
        pickStrategy.setCurrentSublistValue({sublistId: "zones", fieldId: "zone", value: zoneLine.zoneId});
        pickStrategy.commitLine({sublistId: "zones"});
    }

    function editZoneLine(pickStrategy, zoneLine) {
        pickStrategy.selectLine({sublistId: "zones", line: zoneLine.line});
        pickStrategy.setCurrentSublistValue({sublistId: "zones", fieldId: "priority", value: zoneLine.sequence});
        pickStrategy.setCurrentSublistValue({sublistId: "zones", fieldId: "zone", value: zoneLine.zoneId});
        pickStrategy.commitLine({sublistId: "zones"});
    }

    function setTranslationValues(pickStrategy, translation) {
        var lineNumber = pickStrategy.findSublistLineWithValue({sublistId: "translations", fieldId: "language", value: translation.languageName});
        pickStrategy.selectLine({sublistId: "translations", line: lineNumber});
        pickStrategy.setCurrentSublistValue({sublistId: "translations", fieldId: "name", value: translation.name});
        pickStrategy.setCurrentSublistValue({sublistId: "translations", fieldId: "description", value: translation.description});
        pickStrategy.commitLine({sublistId: "translations"});
    }

    createPickStrategy();
    // editPickStrategy();
}); 

          

Related Topics

General Notices