[Vtigercrm-developers] service contract to product

Revathy Sankaranarayanan revathy.sankaran at sybrant.com
Thu Jan 26 20:54:23 PST 2012


Hi  Nicolas,

Thanks. This is what I was expecting.

Regards
*Revathy*

On Wed, Jan 25, 2012 at 5:36 PM, Nicolas Larcipretti <
niclarcipretti at gmail.com> wrote:

> Hi,
>
> You can create a relation field on one of them with a vtlib script like
> this:
>
> <?php
> require_once 'vtlib/Vtiger/Block.php';
>
> //Some block on the service contract module
> $blockInstance = Vtiger_Block::getInstance(blockNumber);
>
> $fieldInstance = new Vtiger_Field();
> $fieldInstance->name = 'rel_product';
> $fieldInstance->label = 'Product';
> $fieldInstance->table = 'vtiger_servicecontractscf';
> $fieldInstance->column = 'rel_product';
> $fieldInstance->columntype = 'VARCHAR(255)';
> $fieldInstance->uitype = 10;
> $fieldInstance->typeofdata = 'V~O';
>
> $blockInstance->addField($fieldInstance);
>
> $fieldInstance->setRelatedModules(Array('Products'));
>
> ?>
>
> Maybe that will do the trick for you.
>
> Cheers
>
> Nicolas
>
> 2012/1/25 Revathy Sankaranarayanan <revathy.sankaran at sybrant.com>
>
>> Hi,
>>
>> I would like to know how we can associate a service contract with a
>> product.
>>
>> Urgent Help is appreciated.
>>
>> Regards
>> *Revathy S*
>>
>>
>> _______________________________________________
>> http://www.vtiger.com/
>>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20120127/54414503/attachment-0002.html 


More information about the vtigercrm-developers mailing list