[Vtigercrm-developers] getting a list of products

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Tue Mar 25 06:17:27 GMT 2014


Hi Uma

I found I had to include the following to get it to work

require_once 'include/utils/utils.php';
require_once 'include/utils/CommonUtils.php';
require_once 'includes/Loader.php';
vimport ('includes.runtime.EntryPoint');

Without the last 'vimport' The script would die when trying to load the language files. For some reason I have not fathomed yet the script would attempt to load a non existent file and silently die.

It would die at this line

vtigerCRM/includes/Loader.php.Vtiger_Loader::includeOnce:61

       static function includeOnce($qualifiedName, $supressWarning=false) {

              if (isset(self::$includeCache[$qualifiedName])) {
                     return true;
              }

              $file = self::resolveNameToPath($qualifiedName);

              if (!file_exists($file)) {
                     return false; <== dies here. Because it can't find modules/Vtiger/handlers/Language.php
              }

              // Check file inclusion before including it
              checkFileAccessForInclusion($file);


Called from vtigerCRM/includes/Loader.php.Vtiger_Loader::autoLoad:183


When I have the correct files included Vtiger_Loader::autoload is not called at all. So there seems to be a missing class somewhere

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/20140325/8b6364fc/attachment.html>


More information about the vtigercrm-developers mailing list