[Vtigercrm-developers] Access quote lineitems from custom module

Richard Hills - Technologywise richard at tw.co.nz
Fri Feb 6 06:45:14 GMT 2015


Thanks Alan, that's definitely a lot better.

On 06/02/15 05:43, Alan Lord wrote:
> On 05/02/15 15:23, lajeesh k wrote:
>> Use getAssociatedProducts function  in include/utils/EditViewUtils.php
>>
>> $focus = CRMEntity::getInstance($module);
>> $focus->id = $recordId;
>> $related_products= getAssociatedProducts($module,$focus);
>
> Why?
>
> This is old code. Surely it is better and more "correct" now to use 
> the MVC pattern and use the Record model.
>
> In a Quote the Record model extends the Inventory Record model which 
> extends the Vtiger Record Model. In the Inventory Record model are all 
> the APIs required to retrieve the data in the correct format and with 
> the correct permissions.
>
> $recordModel = Vtiger_Record_Model::getInstanceById(crmid, 'Quotes');
> $lineItems = $recordModel->getProducts();
>
> HTH
>
> Al
>
>
> _______________________________________________
> http://www.vtiger.com/



More information about the vtigercrm-developers mailing list