[Vtigercrm-developers] default filter
Saqib Qureshi
msq2004 at gmail.com
Wed Oct 12 02:37:21 PDT 2011
This is a Vtiger CRM Table Structure. in case of any issue kindly send me
screen shout.
On Wed, Oct 12, 2011 at 4:10 AM, Doug Creviston <
dcreviston at reality-technology.com> wrote:
> I am unable to create or modify the default filter using vtlib here is my
> code:
>
> <html>
> <body>
> <?php
> error_reporting(E_ALL);
> ini_set('display_errors','On');
>
> // Turn on debugging level
> $Vtiger_Utils_Log = true;
> echo "before include";
>
> //echo "<br> after include";
> require_once('vtlib/Vtiger/Module.php');
> $moduleInstance = Vtiger_Module::getInstance('PriceBooks');
> $moduleInstance->initWebservice();
>
> //echo <br> $moduleInstance = Vtiger_Module::getInstance('PriceBook');";
> $block1 = new Vtiger_Block();
>
> $block1->label = 'LBL_PRICEBOOK_INFORMATION';
> echo "<br> $block1->label = 'LBL_PRICEBOOK_INFORMATION';";
> $moduleInstance->addBlock($block1);
>
> $field1 = new Vtiger_Field();
> $field1->name = 'txt_markup';
> $field1->label = 'Markup';
> $field1->columntype = 'VARCHAR(50)';
> $field1->uitype = 1;
> $field1->typeofdata = 'V~O';
> $block1->addField($field1);
>
> $field2 = new Vtiger_Field();
> $field2->name = 'default_pricebook';
> $field2->label = 'Default Pricebook';
> $field2->columntype = 'CHAR';
> $field2->uitype = 56;
> $field2->typeofdata = 'V~O';
> $block1->addField($field2);
>
> // Create default custom filter (mandatory)
> $filter1 = new Vtiger_Filter();
> $filter1->name = 'All';
> $filter1->isdefault = true;
> $moduleInstance->addFilter($filter1);
>
> $filter1->addField($field2);
>
> ?>
> <p>working.</p>
> </body>
> </html>
>
> here is the error I am getting when I execute the code:
> Notice: Undefined variable: module in
> C:\xampp\htdocs\vtigercrm-5.2.1\apache\htdocs\vtigerCRM\api.pricebook.php on
> line 43
>
> Fatal error: Call to a member function addFilter() on a non-object in
> C:\xampp\htdocs\vtigercrm-5.2.1\apache\htdocs\vtigerCRM\api.pricebook.php on
> line 43
>
> iframe
>
> Posts: 21
> Joined: Mon Jun 06, 2011 4:22 pm
>
>
>
>
>
> Doug Creviston
> Software Analyst
> Reality Technology Inc.
> (303) 757-1107
> 2444 Washington Street, Denver, CO, 80205
> _______________________________________________
> http://www.vtiger.com/
>
--
Regards,
Muhammad Saqib Qureshi
----------------------------------------
Senior Software Engineer (PHP)
Web Development Department
Mobile: (92) 300-2300278
E-mail: msq2004 at gmail.com
LinkedIn: http://pk.linkedin.com/in/muhammadsaqibqureshi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20111012/f3e7f01e/attachment-0002.html
More information about the vtigercrm-developers
mailing list