How to add relationship in vTigerCRM 7.*

Here method using with PHP code.

Create a php file into your root dir of vtiger as create_relation.php.

setRelatedList(
$accountsModule, $relationLabel, Array(‘ADD’) //you can do select also Array(‘ADD’,’SELECT’)
);

echo “done”;

Using this vtiger_relatedlists table, relationships are being established

Enjoy!