[Vtigercrm-developers] realated field's content of the Users module changes in a strange way

Szabesz szabeszg at gmail.com
Mon Sep 17 06:08:17 PDT 2012


Hi list,

I have created a custom entity module and it is working fine except the field that should store a user form the Users module.

The code that generates the field is this:

$fieldProjectGroups8 = new Vtiger_Field();
$fieldProjectGroups8->name = 'linktouser';
$fieldProjectGroups8->label= 'Professional Assistance';
$fieldProjectGroups8->column = 'linktouser';
$fieldProjectGroups8->columntype = 'VARCHAR(100)';
$fieldProjectGroups8->table = 'vtiger_projectgroups';
$fieldProjectGroups8->uitype = 10;
$fieldProjectGroups8->typeofdata = 'V~M';
$blockProjectGroups1->addField($fieldProjectGroups8);
$fieldProjectGroups8->setRelatedModules(Array('Users'));

The field seems to be working fine in the UI, but after saving the record it changes to different entities, such as a Contact or if I choose another user it changes to an Organization. So the user pop-up window lets me choose a user, but saving it sets up a different relationship and I can even click on the related item and it the link works, but of course I need to store a user in this field, not anything else "at random"...

Can anyone help me to fix it? I really have no clue what I should do to set it up properly.

thanx in advance
Szabesz


More information about the vtigercrm-developers mailing list