Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (26 sloc) 1.34 KB

Link to existing Item

This example shows how to create link from one existing item to another. In other words, basic relation.

First we create array of relation criteria. We need to know GUIDs of two items we want to link an their respective foldernames. The word GENERAL in relation type means, that this will be basic relation, simple link between two items. Saving itself is realized through function $connector->saveRelation() .

// Specifications of our relation
$relation = array(
				'ItemGUID1'     => '129641b8-3677-11e7-9e49-080027cbca76',
				'ItemGUID2'     => 'd9705ddc-9161-44e3-82cd-0bd0063b66f5',
				'FolderName1'   => 'Projects',
				'FolderName2'   => 'Contacts',
				'RelationType'  => 'GENERAL'

// Save the relation
$output = $connector->saveRelation($relation);


In this example we took project with one already related contact.

example output

After executing the code, we should see the second contact in the contacts tab on project.

example output

Raw output

Alternatively, you can add var_dump($output) at the end of the example code to see raw output.

Sample code

To see the whole sample code click here

Folder name

To ease understanding folder names, look here.

You can’t perform that action at this time.