This is a Vtiger CRM Table Structure. in case of any issue kindly send me screen shout.<br><br><br><div class="gmail_quote">On Wed, Oct 12, 2011 at 4:10 AM, Doug Creviston <span dir="ltr"><<a href="mailto:dcreviston@reality-technology.com">dcreviston@reality-technology.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I am unable to create or modify the default filter using vtlib here is my code:<br>
<br>
<html><br>
<body><br>
<?php<br>
error_reporting(E_ALL);<br>
ini_set('display_errors','On');<br>
<br>
// Turn on debugging level<br>
$Vtiger_Utils_Log = true;<br>
echo "before include";<br>
<br>
//echo "<br> after include";<br>
require_once('vtlib/Vtiger/Module.php');<br>
$moduleInstance = Vtiger_Module::getInstance('PriceBooks');<br>
$moduleInstance->initWebservice();<br>
<br>
//echo <br> $moduleInstance = Vtiger_Module::getInstance('PriceBook');";<br>
$block1 = new Vtiger_Block();<br>
<br>
$block1->label = 'LBL_PRICEBOOK_INFORMATION';<br>
echo "<br> $block1->label = 'LBL_PRICEBOOK_INFORMATION';";<br>
$moduleInstance->addBlock($block1);<br>
<br>
$field1 = new Vtiger_Field();<br>
$field1->name = 'txt_markup';<br>
$field1->label = 'Markup';<br>
$field1->columntype = 'VARCHAR(50)';<br>
$field1->uitype = 1;<br>
$field1->typeofdata = 'V~O';<br>
$block1->addField($field1);<br>
<br>
$field2 = new Vtiger_Field();<br>
$field2->name = 'default_pricebook';<br>
$field2->label = 'Default Pricebook';<br>
$field2->columntype = 'CHAR';<br>
$field2->uitype = 56;<br>
$field2->typeofdata = 'V~O';<br>
$block1->addField($field2);<br>
<br>
// Create default custom filter (mandatory)<br>
$filter1 = new Vtiger_Filter();<br>
$filter1->name = 'All';<br>
$filter1->isdefault = true;<br>
$moduleInstance->addFilter($filter1);<br>
<br>
$filter1->addField($field2);<br>
<br>
?><br>
<p>working.</p><br>
</body><br>
</html><br>
<br>
here is the error I am getting when I execute the code:<br>
Notice: Undefined variable: module in C:\xampp\htdocs\vtigercrm-5.2.1\apache\htdocs\vtigerCRM\api.pricebook.php on line 43<br>
<br>
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<br>
<br>
iframe<br>
<br>
Posts: 21<br>
Joined: Mon Jun 06, 2011 4:22 pm<br>
<font color="#888888"><br>
<br>
<br>
<br>
<br>
Doug Creviston<br>
Software Analyst<br>
Reality Technology Inc.<br>
<a href="tel:%28303%29%20757-1107" value="+13037571107">(303) 757-1107</a><br>
2444 Washington Street, Denver, CO, 80205<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>Muhammad Saqib Qureshi<br>----------------------------------------<br>Senior Software Engineer (PHP)<br>Web Development Department<br>Mobile: (92) 300-2300278<br>
E-mail: <a href="mailto:msq2004@gmail.com" target="_blank">msq2004@gmail.com</a><br>LinkedIn: <a href="http://pk.linkedin.com/in/muhammadsaqibqureshi" title="View public profile" name="SafeHtmlFilter_webProfileURL" target="_blank">http://pk.linkedin.com/in/muhammadsaqibqureshi</a><span></span><br>
<div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>