• Create a new domain with the given kind, domainDesign, and options or specify a domain template to use for the domain creation. Not all domain kinds can be created through this API. See CreateDomainOptions.kind for supported domain kinds.

    For each domain you can specify each field's metadata. The properties for field's can be found on DomainDesign.fields.

    LABKEY.Domain.create({
    kind: 'IntList',
    domainDesign: {
    name: 'LookupCodes',
    description: 'integer key list',
    fields: [{
    name: 'id',
    rangeURI: 'int',
    },{
    name: 'code',
    rangeURI: 'string',
    scale: 4,
    }]
    },
    // Domain kind specific options
    options: {
    // These options are specific to an 'IntList'
    keyName: 'id',
    keyType: 'Integer', // or 'AutoIncrementInteger'
    },
    });

    Create domain from a domain template:

    LABKEY.Domain.create({
    module: 'mymodule',
    domainGroup: 'codes',
    domainTemplate: 'LookupCodes',
    importData: false,
    });

    Import the initial data from the domain template of a previously created domain:

    LABKEY.Domain.create({
    module: 'mymodule',
    domainGroup: 'codes',
    domainTemplate: 'LookupCodes',
    createDomain: false,
    importData: true,
    });

    Parameters

    Returns XMLHttpRequest