0

I hope all of you are doing well. I have created 1:M relationship between custom modules and Custom relationship used this script.we have run this script in root folder. 1:M relationship are working fine and relationship view also perfect.

                               Calendar (Activities)
  <?php
  include_once('vtlib/Vtiger/Module.php');
  $moduleInstance = Vtiger_Module::getInstance('Laptops');  //Custom Module Name
  $accountsModule = Vtiger_Module::getInstance('Calendar');
   $relationLabel  = 'Activities';
   $moduleInstance->setRelatedList(
   $accountsModule, $relationLabel, Array('ADD','SELECT'), 'get_activities'
  );

  echo "Activities have been added for Your_Custom_Module_Name Module";
  ?>

1 Answers1

0

You can do the same using the below code which you can execute with some vtLib files included in your custom file or you can execute from any module Class file.

$moduleInstance->unsetRelatedList(
    $accountsModule, $relationLabel, 'get_activities'
);
Milan Malani
  • 1,818
  • 1
  • 22
  • 34