Find references
Syntax
$object.referers(`$attr`)
Description
Gets the set of objects that reference object in the attribute attr.
It is equivalent to the inverse function of get() when it returns a list of referenced objects.
Parameters
| Name | Type | Description | Mandatory | Default |
|---|---|---|---|---|
| object | Business object | The object for which to check which other objects reference it in attr. |
yes | |
| attr | String | The attribute literal in which object should be referenced. |
yes |
Return value
Type: Set
A set of objects referencing object in attr.
Examples
{
object = all(`my.module:MyType`).filter(element -> $element.get(`my.module:MyType#myAttr`).isStringEqual("test"));
$object.referers(`my.module:MyType#myAttr`);
}
Output: A list of all objects that reference the object named "test" in the myAttr attribute.