[Vtigercrm-developers] HelpDesk - Relate to only accounts

Richard Hills richard at tw.co.nz
Tue Nov 13 18:13:16 PST 2012


Thanks for the reply Alan, unfortunately this function does not work for 
uitype 68.

On a related note, does anyone know if the dev team are planning on 
"vtlib-ising" the existing modules which currently don't operate within 
its bounds?



On 13/11/12 21:54, Alan Lord wrote:
>
> On 13/11/12 03:33, Richard Hills wrote:
>> Can anyone tell me how to remove the ability for a helpdesk ticket to be
>> related to a contact?
> Using vtlib, you can *unset* stuff too...
>
> Below is an example of some of my vtlib creation code which tests for
> the existence of a field in my module, if it is there, removes it, then
> re-creates it... (I do this for all my vtlib stuff so I can re-run it
> again and again whilst developing.)
>
> I'm pretty sure you could run this against the HelpDesk module to remove
> the 'Accounts' relation from the setRelatedModule call. (I haven't
> tested this BTW it's just a snippet from my normal code)
>
> // Set the Contact/Account popup relation
> $field_relate = Vtiger_Field::getInstance('parent_id', $module);
> if ($field_relate != false) {
> 	$field_relate->unsetRelatedModules(Array('Contacts', 'Accounts'));
> 	$field_relate->delete();
> }
> $field_relate = new Vtiger_Field();
> $field_relate->name = 'parent_id';
> $field_relate->label= 'Related to';
> $field_relate->column = 'parent_id';
> $field_relate->columntype = 'INT(11)';
> $field_relate->uitype = 10;
> $field_relate->typeofdata = 'V~M';
> $block_main->addField($field_relate);
> $field_relate->setRelatedModules(Array('Contacts'));
>
> Obviously I would try this on a dev system first ;-)
>
> PS: I notice that the HelpDesk Related To field is a UI Type 68!!! I
> guess this must be a throw back to pre-vtlib days. Hmm, I'd still give
> the above a try and see what happens.
>
> HTH
>
> Al
>
>
> _______________________________________________
> http://www.vtiger.com/


-- 
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
richard at tw.co.nz
www.technologywise.co.nz
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061



More information about the vtigercrm-developers mailing list