Relations

Resource type: relation

Hereby relations between 2 data sets can be modified. In enterprise, there are many ways to link two records together. In case that the relation does not exist, an error will be generated.

Each relation type determines which of the two records is the “parent” record and which is the “child” record. The names of the constants always contain first the name of the parent record, then the child record. Last element is a short description of the relation. The type of relation is given according to the following scheme:

urn:onoffice-de-ns:smart:2.5:relationTypes:<parent-type>:<child-type>:<description>

As a concrete example, consider the possible relations between an estate and an address.

Parameters:

  • parentid
    INTEGER. Estate ID
  • childid
    INTEGER. Address ID
  • relationtype
    STRING. Description of the link. The possible links between an object and an address are:
    • Buyer: 'urn:onoffice-de-ns:smart:2.5:relationTypes:estate:address:buyer'
    • Tenant: 'urn:onoffice-de-ns:smart:2.5:relationTypes:estate:address:renter'
    • Owner: 'urn:onoffice-de-ns:smart:2.5:relationTypes:estate:address:owner'
    • Contact person(only brokers): 'urn:onoffice-de-ns:smart:2.5:relationTypes:estate:address:contactPerson'
    • All contact persons: 'urn:onoffice-de-ns:smart:2.5:relationTypes:estate:address:contactPersonAll'
  • relationinfo
    STRING. Further informations about a relation can be modified by the parameter relationinfo. For now, only the confirmation status of an appointment can be modified by relationinfo.
    Syntax: "relationinfo": {"statusTerminbestaetigung": "gecancelt"}.
    Options are: bestätigt (confirmed), gesendet (sent), gecancelt (cancelled), nicht gesetzt (not set). See also example below for usage.

Example:

...
"actions":[ 
{
    "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:modify",
    "resourceid": "",
    "identifier": "",
    "resourcetype": "relation",
    "parameters": {
        "relationtype": "urn:onoffice-de-ns:smart:2.5:relationTypes:calendar:address",
        "parentid": 671,
        "childid": 153,
        "relationinfo": {
            "statusTerminbestaetigung": "gecancelt"
        }
    }
}
...

Other important relation types are for example:

'urn:onoffice-de-ns:smart:2.5:relationTypes:estate:address:interested' An estate is assigned to the address of an interested party.
'urn:onoffice-de-ns:smart:2.5:relationTypes:estate:estateUnit' A base object is assigned estate units.
'urn:onoffice-de-ns:smart:2.5:relationTypes:calendar:address' An appointment is linked to an address.
'urn:onoffice-de-ns:smart:2.5:relationTypes:calendar:estate' An appointment is linked to an estate.
'urn:onoffice-de-ns:smart:2.5:relationTypes:agentsLog:file:attachment' An agents log entry is assigned a file attachment.
'urn:onoffice-de-ns:smart:2.5:relationTypes:agentsLog:address' An agents log entry is assigned an address.
'urn:onoffice-de-ns:smart:2.5:relationTypes:agentsLog:estate' An agents log entry is assigned an object.