[Vtigercrm-developers] getting a list of products

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Tue Mar 18 03:35:48 GMT 2014


Hi Uma

Thank you for this.
Can you tell me what files I need to include to create the listview

I have tried including the following..
require_once('include/utils/CommonUtils.php');
require_once('include/utils/ListViewUtils.php');
require_once('modules/Vtiger/models/ListView.php'); <== script quits here with no errors

$listViewModel = Vtiger_ListView_Model::getInstance('Products', 47); //&viewname=47

Is there some documentation on what files I need to include?

The module acts as a simple webservice so I will want to authenticate against a user with limited roles. So how do I do authentication?

Chris


From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Uma S
Sent: Monday, 17 March 2014 4:06 PM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] getting a list of products

Hi Chris,

Their is a way to achieve your requirement.

 1.  Please create a filter with all custom-fields that you would like get in list-view.
 2.  Now create a list-view model of a module (products), by passing moduleName and filter-id.
 3.  Then on this list-view model you can call getListViewEntries() api to get entries of list-view with all custom fields.
Regards
Uma S
Vtiger Team

On Mon, Mar 17, 2014 at 4:32 AM, Hamono, Chris (DPC) <Chris.Hamono at sa.gov.au<mailto:Chris.Hamono at sa.gov.au>> wrote:
In answer to my own question.

I don't know what the official ways is to get  a list including custom fields but this is what I have discovered...

When a custom field is made it adds a new column to the table vtiger_ Modulenamecf in my case vtiger_ productcf. The field name is something along the lines of cf_### where ### = some number, for me this was cf_716.

This is recorded in the vtiger_fields  table, the important fields for my purpose are "column name" "tablename" and "fieldlabel" these contain the information required to map the mysterious cf_### column name to the custom field.

I assume there is a method that will do all of this for you but as far as I can find to get a list of products I will have to find all the custom fields using vtiger_fields manually build a sql statement to include those fields and then run that query.


Chris



From: vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com> [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com>] On Behalf Of Hamono, Chris (DPC)
Sent: Friday, 14 March 2014 11:26 AM
To: vtigercrm-developers at lists.vtigercrm.com<mailto:vtigercrm-developers at lists.vtigercrm.com>
Subject: [Vtigercrm-developers] getting a list of products

Hi All

I am hoping someone can help me

I am developing a module to integrate vtiger with drupal for a bespoke system. I have a need to get a list of products complete with custom fields. I also need to filter this list by range (limit) and by product type

What is the recommended way to query a module for a list. I have tried to look through the source code but its very obtuse and haven't yet found what I need.

Any assistance would be appreciated

Chris




_______________________________________________
http://www.vtiger.com/



--
With
Best Regards
Uma.S
Vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140318/8a9a26ce/attachment-0001.html>


More information about the vtigercrm-developers mailing list