Function create

  • Create a new List. Lists support three types of primary key configurations; IntList, VarList, or AutoIncrementInteger. These key configurations determine what "kind" of List is created. If the key field configuration is not provided in the domain design's array of fields, it will be automatically added to the domain. Note: If a domainDesign is specified then it's configuration will take precedence over other DomainDesign properties that are specified.

     // Creates a List with a string primary key.
    LABKEY.List.create({
    fields: [{
    name: 'partCode', rangeURI: 'string',
    },{
    name: 'manufacturer', rangeURI: 'string',
    },{
    name: 'purchaseDate', rangeURI: 'date',
    }],
    kind: 'VarList',
    name: 'Parts',
    options: {
    keyName: 'partCode',
    keyType: 'Varchar',
    }
    });

    // Creates a List with an auto-incrementing primary key.
    LABKEY.List.create({
    description: 'teams in the league',
    kind: 'IntList',
    fields: [{
    name: 'rowId', rangeURI: 'int',
    },{
    name: 'name', rangeURI: 'string', required: true,
    },{
    name: 'slogan', rangeURI: 'multiLine',
    },{
    name: 'logo', rangeURI: 'Attachment',
    }],
    name: 'Teams',
    options: {
    keyName: 'rowId',
    keyType: 'AutoIncrementInteger',
    }
    });

    Parameters

    Returns void

Generated using TypeDoc