Hi Albert,
Please correct me if i'm wrong, what you need is to have the value of a drop down list from your custom module to the same list but in Contacts, right?
Well, if thats the case, first you need to have the same list on both modules so the value can be homogeneous. then, you need to create a logic hook on your custom module so, after the record saves its info in the database, the hook can update the value on contacts, it'll look like this (kinda
):
PHP Code:
function mirror(&$bean, $event, $arguments)
{
$db = DBManagerFactory::getInstance();
$contactid = $bean-> RELATE_WITH_CONTACTS; //This is the ID of the contact related, the name of the field can be found on the VarDerf.php, inside /Custom/modules/your_module/metadata/Vardefs, it looks something like "module_key_module_name"
$list_value = $bean-> LIST_NAME; //Value of your list on custom module
$query = 'UPDATE Contacts_cstm ' //This is where your custom list should be in the DB
.' SET list_c = "' $list_value .'" ' //This is the value of your list on your custom module that is going to your contacts field in the DB
.' WHERE Contacts.id = "' $contactsid .'" ';
$result = $db->query($query, true, 'Error on UPDATE');
}
Remember to adjust the names of your DB fields and your vardefs, if you have troubles with this, feel free to ask 
Good luck Albert
Bookmarks