tryGetInstance Method

Get a Relationship instance

tryGetInstance<T extends Relationship>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T extends Relationship | undefined

note Useful for cases when a relationship may or may not exist and throwing an Error would be overkill.

see Relationships.getInstance

Parameter Type Description
relClassFullName string The full class name of the relationship in the form of "schema:class"
criteria Id64String | SourceAndTarget Either the relationship instanceId or the source and target Ids

Returns - The relationship or undefined if the relationship is not found.

Defined in

Last Updated: 08 January, 2020