Function createStorageItem

  • Create a new LabKey Freezer Manager storage item that can be used in the creation of a freezer hierarchy. Freezer hierarchies consist of a top level Freezer, which can have any combination of child non-terminal storage locations (i.e. those that do not directly contain samples but can contain other units) and terminal storage locations (i.e. units in the freezer that directly contain samples and cannot contain other units). See the LabKey Documentation for further details.

    A freezer may also have a parent hierarchy, which defines the physical location of the freezer. See the LabKey Documentation for further details.

    // Create a freezer with two shelves
    LABKEY.Storage.createStorageItem({
    type: 'Freezer',
    props: {
    name: 'Freezer #1',
    description: 'Test freezer from API',
    serialNumber: 'ABC123',
    status: 'Active'
    },
    success: function(response) {
    console.log(response);
    var freezerRowId = response.data.rowId;

    LABKEY.Storage.createStorageItem({
    type: 'Shelf',
    props: {
    name: 'Shelf #1',
    description: 'This shelf is for samples from Lab A.',
    locationId: freezerRowId
    },
    success: function(response) {
    console.log(response);
    }
    });

    LABKEY.Storage.createStorageItem({
    type: 'Shelf',
    props: {
    name: 'Shelf #2',
    description: 'This shelf is for samples from Lab B.',
    locationId: freezerRowId
    },
    success: function(response) {
    console.log(response);
    }
    });
    }
    });
    // Create a terminal storage location in the freezer
    LABKEY.Storage.createStorageItem({
    type: 'Storage Unit Type',
    props: {
    name: '10 X 10 Box',
    unitType: 'Box',
    rows: 10,
    cols: 10
    },
    success: function(response) {
    console.log(response);
    var boxTypeId = response.data.rowId;

    LABKEY.Storage.createStorageItem({
    type: 'Terminal Storage Location',
    props: {
    name: 'Box #1',
    typeId: boxTypeId,
    locationId: 8088, // rowId of Shelf #2
    },
    success: function(response) {
    console.log(response);
    }
    });
    }
    });

    Parameters

    Returns XMLHttpRequest

Generated using TypeDoc