Supply Chain Snapshot

The internal ID for this record is supplychainsnapshot.

The Supply Chain Snapshot record is available only when the following features are enabled:

Use the Supply Chain Control Tower feature in your NetSuite OneWorld account to simulate inventory supply and demand across your supply chain. These simulations, or Snapshots, are used to analyze whether inventory levels are in line with demand or planned levels. This feature can help you to juggle how to match customer requests with supply availability.

For help working with this record in the UI, see Supply Chain Control Tower.

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.

See Supply Chain Snapshot Record Actions for actions associated with this record. For more information about actions and macros, see Overview of Record Action and Macro APIs.

Supported Script Types

The Supply Chain Snapshot record is scriptable in both client and server SuiteScript.

Supported Operations

The Supply Chain Snapshot record can be created, read, edited, deleted, and searched using SuiteScript. It cannot be copied.

Usage Notes

Supply Chain Snapshot details are based on a saved search. The record is scriptable in the same way that saved searches are scriptable. Because it is a snapshot of transactional data, you can refresh this view or run the snapshot details search as needed.

There are two types of saved searches that are associated with Supply Chain Snapshots:

Field values on the record header can be set using scripts. Some fields are read-only or have special behaviors. Please see the table below for details.

The following are applicable elements of the Supply Chain Snapshot record:

Fields

Field Id

Field Label

Type

Description

memo

Memo

textarea

A typical memo field that can be set on create or edit.

item

Item Name / Number

select

On create, value is selected or passed in as parameter.

On edit, snapshot record is tied to item id, so the item field is read-only.

replenishmentmethod

Replenishment Method

select

This field is read-only. Its value is derived from the item record.

daterun

Date Run

datetime

This field is read-only.

If refresh = true, it is the datetime stamp from when the data on the record was last refreshed.

If refresh = false, it has not been updated.

pasthorizon

Past Horizon

select

Can be set on create.

If refresh = T, can be set on edit.

Options (in days): 7, 14, 30, 45, 60

Defaults to the value set in Setting Supply Chain Control Tower Preferences.

futurehorizon

Future Horizon

integer

This field is read-only. Its value is derived from the item record.

If the item record value is empty, it derives its value from the value set in Setting Supply Chain Control Tower Preferences.

The value must be between 0 and 365 days.

futurehorizondate

Future Horizon Date

date

This field is read-only.

It is calculated as follows:

current date + the number of days set in the Past Horizon field.

refresh

Refresh Summary

checkbox

This is a non-persisted value.

On create, this field cannot be set because data is fetched when the record is first created.

On edit, this field determines whether to refresh the search results of snapshot details.

externalid

ExternalId

text

Hidden by default in the UI.

stockunit

Stock Unit

select

This field is read-only and shows only when the Multiple Units of Measure feature is enabled .

Its value is derived from the value for Stock Units on the item record.

Additional Notes

Code Samples

The following sample shows how to create an item and set the future horizon to 10 days.

          var item = record.create({
    type: record.Type.INVENTORY_ITEM
}); 
item.setValue({
    fieldId: 'itemid',
    value: 'SS item test'
}); 
item.setValue({
    fieldId: 'taxschedule',
    value: '1'
}) 
item.setValue({
    fieldId: 'futurehorizon',
    value: '10'
}); 
var itemId = item.save(); 

        

The following sample shows how to generate snapshot for that item with past horizon of 14 days.

          var snap = record.create({
    type: record.Type.SUPPLY_CHAIN_SNAPSHOT
});
snap.setValue({
    fieldId: 'item',
    value: '7'
}); 
snap.setValue({
    fieldId: 'pasthorizon',
    value: '14'
}); 
var snapId = snap.save(); 

        

The following sample shows how to refresh the snapshot for an item with a past horizon of 7 days.

          var loadSnap = record.load({
    type: record.Type.SUPPLY_CHAIN_SNAPSHOT,
    id: snapId,
    defaultValues: true
});
loadSnap.setValue({
    fieldId: 'refresh',
    value: 'T'
}); 
loadSnap.setValue({
    fieldId: 'pasthorizon',
    value: '7'
}); 
loadSnap.setValue({
    fieldId: 'memo',
    value: 'updated ss memo'
}); 
var recID = loadSnap.save(); 

        

The following sample shows how to create a saved search for a snapshot record.

          var mySearch = search.create({
    type: search.Type.SUPPLY_CHAIN_SNAPSHOT,
    title: 'Snapshot header search for test item2',
    id: 'customsearch_scct',
    columns: [{
        name: 'item'
    }, {
        name: 'memo'
    }, {
        name: 'daterun'
    }],
    filters: [{
        name: 'item',
        operator: search.Operator.IS,
        values: itemId
    }]
});
var customsearch_scctId = mySearch.save(); 

        

The following sample shows how to create a saved search for snapshot details.

          var mySearch = search.create({
    type: 'supplychainsnapshotdetails',
    title: 'Snapshot details search for test item2',
    id: 'customsearch_scct_details',
    columns: [{
        name: 'docnum'
    }, {
        name: 'location'
    }, {
        name: 'invbalance'
    }],
    filters: [{
        name: 'item',
        operator: search.Operator.IS,
        values: itemId
    }]
});
var customsearch_scct_detailsId = mySearch.save(); 

        

The following sample shows how to load a search for snapshot record.

          var loadSearch= search.load({
    type: search.Type.SUPPLY_CHAIN_SNAPSHOT,
    id: 'customsearch_scct'
}); 

        

The following sample shows how to load search for snapshot details.

          var loadSearchDetails= search.load({
    type: 'supplychainsnapshotdetails',
    id: 'customsearch_scct_details'
}); 

        

Related Topics

General Notices