insert MethodStatic


insert(txn, definitionModelId, code, isPrivate?) @beta

Insert a DefinitionContainer and its sub-model.

insert(txn: EditTxn, definitionModelId: string, code: Code, isPrivate?: boolean): string

@returns The Id of the newly inserted DefinitionContainer and its newly inserted sub-model (of type DefinitionModel).

@note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.

@throws IModelError if there is a problem inserting the DefinitionContainer

Parameter Type Description
txn EditTxn  
definitionModelId string The Id of the DefinitionModel that will contain this DefinitionContainer element.
code Code The Code for this DefinitionContainer.
isPrivate boolean The optional hint, that if true means it should not be displayed in the UI.

Returns - string

The Id of the newly inserted DefinitionContainer and its newly inserted sub-model (of type DefinitionModel).



insert(iModelDb, definitionModelId, code, isPrivate?)

Deprecated  Use DefinitionContainer.insert(txn, ...) instead.

insert(iModelDb: IModelDb, definitionModelId: string, code: Code, isPrivate?: boolean): string

Parameter Type Description
iModelDb IModelDb  
definitionModelId string  
code Code  
isPrivate boolean  

Returns - string


Defined in

Last Updated: 25 April, 2026