[Vtigercrm-developers] vtiger 5.2.0 Projects Module

Joe Bordes joe at tsolucio.com
Thu Jul 1 09:57:50 PDT 2010


Hi Alan,

To delete a field you can use the delete() method on the field instance.

I haven't really studied your code, but the problem is probably that you 
are missing field properties (at least column) and specially because I 
think I remember that the setrelatedlist parameter is an array. Look at 
the vtlib manual. There are some examples on the trac and you can 
contact me if you want me to send you and example.

Joe
TSolucio

El 01/07/10 14:59, Alan Lord (News) escribió:
> 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
>>
>>
>>      
>
>    




More information about the vtigercrm-developers mailing list