Operators and methods for links

Operators and methods for links

Product line

Standard

|

Expert

Operating mode

CLOUD ABO

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 03.05.2011
Updated: 10.02.2021 | Added identification via Entry ID from version 6.4.0.19.

For the handling of links in scripts and OCL expressions, there are the following operators and methods, which are equally applicable for both types of links (wrapper links, custom links).

<objekt>.linkto(target, Role)

Makes a link (via link type) from the object to the passed object (target) with the specified Role.

The Role is the designation of the desired link role (part of the link type).

As of Vertec 6.4.0.19, the Role can also be entry ID of the link type, followed by _A or _B depending on the side of the left roller (see example below).

<objekt>.unlink(target, Role)

Removes a link from the object to the passed object (target) with the specified Role.

Note for custom links: If delete sharing is configured on this, the link cannot be resolved with the unlink method. The resolution of such a link is only possible by deleting one of the link partner objects.

Example

Link type

The examples refer to the following link type Administrative Boards – Board Cases:

The Role is either the designation on the target’s page:

Or from Vertec 6.4.0.19 onwards, the entry ID of the link type, followed by _A for Role A, or _B for Role B, depending on which page the target has in the link type:

In Python, it looks like this:

  Via Designation Via entry ID (from version 6.4.0.19)

Object: Person

Target: Company

person = argobject
company = vtcapp.getobjectbyid(2995)
person.linkto(company, “Bod-case”)
person = argobject 
company = vtcapp.getobjectbyid(2995)
person.linkto(company, “vr-vrmandate_A”)

Object: Company

Target: Person

person = argobject
company = vtcapp.getobjectbyid(2995)
firma.linkto(person, “Board of Directors”)
person = argobject
company = vtcapp.getobjectbyid(2995)
firma.linkto(person, “vr-vrmandate_B”)

The unlink method works exactly the same. Simply replace linkto with unlink in the code.

OCL operator

usereintrag->getLinks(role)

Returns a list of objects linked to the entry under this Role.

The Role is the designation of the desired link role (part of the link type).

As of Vertec 6.4.0.19, you can also specify the Entry ID of the link type, followed by _A or _B, depending on the page of the link role (see example above).

Person->getLinks('VR-cases’)

or from Vertec 6.4.0.19 also

Person->getLinks('vr-vrmandate_A’)

These are the same entries that appear in the Bod case folder for the person, if it is shown.

Bitte wählen Sie Ihren Standort