[Vtigercrm-developers] vtiger 5.2.0 Projects Module
Alan Lord (News)
alanslists at gmail.com
Thu Jul 1 05:59:16 PDT 2010
On 01/07/10 07:58, Alan Lord (News) wrote:
> On 30/06/10 17:27, Joe Bordes wrote:
>> uitype 10 and setRelatedList
>> Have a read here: http://crmevolutivo.com/wiki/doku.php?id=vtlibrelated
>
> Thanks Joe,
>
> That looks like just the ticket ;-)
OK - Been playing with this a bit.
Nearly got it right I think... But how can I delete a field I've added?
I now have two :-) I do not see a delField() function.
I did this in a quick script:
// Get Module Objects
$project = Vtiger_Module::getInstance('Project');
$contacts = Vtiger_Module::getInstance('Contacts');
// Get Main Block
$proj_info_block = Vtiger_Block::getInstance('LBL_PROJECT_INFORMATION',
$project);
// Create and add a UI Type 10 (Popup) Field
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = 'Contact';
$fieldInstance->uitype = 10;
$fieldInstance->setRelatedModules('Contacts');
$proj_info_block->addField($fieldInstance);
// Add a 1:n relationship between $project & $contacts
$project->setRelatedList($contacts, 'header',
Array('ADD'),'get_dependents_list');
Which "nearly" works.
I have a new UI Type 10 field in the Project Module, but there is an
empty "Related To" picklist and clicking on the plus sign brings up the
box but with the error "Module name is missing. Please check the module
name."
Incidentally, adding this field, seems to make it more a 1:1
relationship and I'd need to add "n" fields.
Am I being thick?
Sorry.
Al
>
> Cheers
>
> Al
>
>
--
The Open Learning Centre
http://www.theopenlearningcentre.com
More information about the vtigercrm-developers
mailing list