12-02-2015, 12:53 PM
(This post was last modified: 12-02-2015, 01:42 PM by Guido1982.
Edit Reason: Added serror messages
)
For my ExactOnline module, I'm in the process of syncing the general ledgers to coreBOS from Exact. I created a dropdown in products like this:
This works, but does produce errors, what am I doing wrong? Here are the errors:
PHP Code:
$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
$module = Vtiger_Module::getInstance('Products');
$infoBlock = Vtiger_Block::getInstance('LBL_PRODUCT_INFORMATION', $module);
$glaccountsField = Vtiger_Field::getInstance('generalledgers', $module);
if (!$glaccountsField) {
$glaccountsField = new Vtiger_Field();
$glaccountsField->name = 'generalledgers';
$glaccountsField->label = 'General Ledger Accounts';
$glaccountsField->column = 'generalledgers';
$glaccountsField->columntype = 'VARCHAR(255)';
$glaccountsField->uitype = 16;
$glaccountsField->typeofdata = 'V~M';
$glaccountsField->setPicklistValues($GLAccountValues);
$infoBlock->addField($glaccountsField);
}
This works, but does produce errors, what am I doing wrong? Here are the errors:
PHP Code:
Strict Standards: Only variables should be assigned by reference in /PATH/crmdevelop/include/database/PearDatabase.php on line 225
Creating table vtiger_generalledgers ... DONE
Strict Standards: Only variables should be assigned by reference in /PATH/crmdevelop/include/database/PearDatabase.php on line 225
Strict Standards: Only variables should be assigned by reference in /PATH/crmdevelop/include/database/PearDatabase.php on line 225
Strict Standards: Only variables should be assigned by reference in /PATH/crmdevelop/include/database/PearDatabase.php on line 225
Creating Field generalledgers ... DONE
Module language mapping for General Ledger Accounts ... CHECK
Catchable fatal error: Object of class Vtiger_Module could not be converted to string in /PATH/index.php on line 687