vTiger - Cannot select Custom module records from a Leads Module under More Information tab

StackOverflow https://stackoverflow.com//questions/20044436

  •  26-12-2019
  •  | 
  •  

Question

I have create a custom module Chat and when am trying to select Chat records from a Leads Module under the More Information tab.

It gives me error "Warning: Invalid argument supplied for foreach() in include\utils\ListViewUtils.php on line 1280" and also its not listing any chats records but its working fine for other vtiger default module

Here is my code to set a Related List

$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');

$accounts=Vtiger_Module::getInstance('Leads');
$accounts->setRelatedList(Vtiger_Module::getInstance('Chat'), 'Chat',Array('ADD','SELECT'));

Please help for this. Thanks in advance.

Was it helpful?

Solution

You have to Create a function as a told in Comment and your code is wrong for set relation between to module. You have to use this code.

 $module = Vtiger_Module::getInstance('Store');
 $storemodule1 = Vtiger_Module::getInstance('Calendar');
 $relationLabel = 'Activities';
 $function_name = 'get_activities';
 $module->setRelatedList( $storemodule1, $relationLabel, Array('ADD','SELECT'), $function_name );

The function which you will create replace it with 'get_activities' and i think you know which other value have to change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top