<div dir="ltr">
Thank you. Any clue what I am missing? I only have the sql error when I 
create a report with this date field using the clause "between" two 
dates, if I use the clause "is" date, doesnt generate the error. 

</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue, 18 feb 2021 a las 9:17, Patrick Alexander Allen (<<a href="mailto:patrick@coazgt.com">patrick@coazgt.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you. Any clue what I am missing? I only have the sql error when I create a report with this date field using the clause "between" two dates, if I use the clause "is" date, doesnt generate the error. <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié, 17 feb 2021 a las 11:58, Uma S (<<a href="mailto:uma.s@vtiger.com" target="_blank">uma.s@vtiger.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Patrick,<div><br></div><div>Sorry! adding a custom field to the Line Items block of inventory module is not supported.</div><div>As the dependencies of these fields are bound.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 11, 2021 at 10:56 PM Patrick Allen Zulueta <<a href="mailto:alexander.allenz@gmail.com" target="_blank">alexander.allenz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello Uma. I triead this way: The field is created but in vtiger_salesorder table, not in vtiger_inventoryproductrel.  Can you tell me what have I to change?<br></div><div><br></div><div>ini_set('memory_limit', '10240M'); <br>set_time_limit(0); <br>ini_set('mysql.connect_timeout','600'); <br>ini_set('max_execution_time', '500000'); <br>$today = date("Y-m-d H:i:s"); <br>require_once 'config.inc.php'; <br>require_once('modules/Emails/mail.php'); <br>if (file_exists('config_override.php')) { include_once 'config_override.php'; } <br>require_once 'includes/Loader.php'; vimport ('includes.runtime.EntryPoint'); <br>global $current_user; <br>global $adb; <br>$db = PearDatabase::getInstance(); <br>$current_user = Users::getActiveAdminUser(); <br>require_once 'vtlib/Vtiger/Utils.php'; <br>$moduleName='SalesOrder'; <br>$moduleInstance = Vtiger_Module::getInstance($moduleName); <br>$blockInstance = Vtiger_Block::getInstance('LBL_ITEM_DETAILS', $moduleInstance); <br>$fieldInstance = new Vtiger_Field(); $fieldInstance->name = 'test'; <br>$fieldInstance->table = $moduleInstance->basetable; <br>$fieldInstance->column = 'test'; <br>$fieldInstance->label='test'; <br>$fieldInstance->columntype = 'DATE'; <br>$fieldInstance->uitype = 23; <br>$fieldInstance->typeofdata = 'D~O'; <br>$fieldInstance->readonly = '1'; <br>$fieldInstance->presence = '2'; <br>$fieldInstance->displaytype = '1'; <br>$fieldInstance->masseditable = '0'; <br>$blockInstance->addField($fieldInstance); <br>echo "Field added."; <br>exit; </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié, 13 ene 2021 a las 10:52, Patrick Allen Zulueta (<<a href="mailto:alexander.allenz@gmail.com" target="_blank">alexander.allenz@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">No, in PurchaseOrder module but in elements block (next to product name, quantity, etc). To create the field I follow this procedure:<div><br></div><div><br><a href="https://danssy.wordpress.com/2017/01/26/vtiger-6-5-add-column-to-item-details-in-invoice-salesorder-quotes/" target="_blank">https://danssy.wordpress.com/2017/01/26/vtiger-6-5-add-column-to-item-details-in-invoice-salesorder-quotes/</a></div><div> </div><div>Image added by reference.</div><div><br></div><div><br>El miércoles, 13 de enero de 2021, Uma S <<a href="mailto:uma.s@vtiger.com" target="_blank">uma.s@vtiger.com</a>> escribió:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">You mean create a field for Products module?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 13, 2021 at 9:03 PM Patrick Allen Zulueta <<a href="mailto:alexander.allenz@gmail.com" target="_blank">alexander.allenz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(34,34,34);font-size:14px">Ok. For inventory Related modules does this work? This is a field that I insert in product elements. How I specify that ?</span><br><br>El miércoles, 13 de enero de 2021, Uma S <<a href="mailto:uma.s@vtiger.com" target="_blank">uma.s@vtiger.com</a>> escribió:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Patrick,<div><br></div><div>Sorry! That will not work, As related dependencies of the field are not set to it's standard.</div><div><br></div><div>Please do follow the <a href="https://community.vtiger.com/help/vtigercrm/developers/vtlib/module-field.html" target="_blank">docs</a>.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 13, 2021 at 8:35 PM Patrick Allen Zulueta <<a href="mailto:alexander.allenz@gmail.com" target="_blank">alexander.allenz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Uma. I didn’t. I create it manually inserting on table vtiger_field, vtiger_inventoryproductrel and also modifying Editviewutils.php and InventoryUtils.php<br><br>El miércoles, 13 de enero de 2021, Uma S <<a href="mailto:uma.s@vtiger.com" target="_blank">uma.s@vtiger.com</a>> escribió:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Patrick,<div><br></div><div>Can I know that you have created a custom field through script or Layout editor?</div><div><br></div><div>Is the case same with module filters as well?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 13, 2021 at 3:01 AM Patrick Allen Zulueta <<a href="mailto:alexander.allenz@gmail.com" target="_blank">alexander.allenz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I create a custom field in table vtiger_inventoryproductrel called "fecha" wich is a date field used in PurchaseOrder module.</div><div><br></div><div>When I create a report with this field in filters and I put Fecha equal (some date) it works well, but when I put Fecha between two dates or today, the report gives me an error.  Does some one has experimented something like this?</div><div><br></div><div>Image 1: Works well with a specific date.<br></div><div><img src="cid:ii_kjui1uoi0" alt="imagen.png" width="471" height="265"></div><div><br></div><div>Image 2: Doesnt works well. I get an error that this field doesnt exist on vtiger_inventoryproductrel table but it exist.</div><div><img src="cid:ii_kjui49k41" alt="imagen.png" width="471" height="265"><br><br></div><div>Here is the query and error:</div><div>
SELECT vtiger_purchaseorder.subject AS 'PurchaseOrder_Subject', 
vtiger_purchaseorder.purchaseorder_no AS 
'PurchaseOrder_PurchaseOrder_No', (CASE WHEN 
vtiger_purchaseorder.vendorid NOT LIKE '' THEN (CASE WHEN 
trim(vtiger_vendorRelPurchaseOrder.vendorname) NOT LIKE '' THEN 
trim(vtiger_vendorRelPurchaseOrder.vendorname) ELSE '' END) ELSE '' END)
 AS 'PurchaseOrder_Vendor_Name', vtiger_purchaseorder.duedate AS 
'PurchaseOrder_Due_Date', vtiger_purchaseordercf.cf_1050 AS 
'PurchaseOrder_Fecha_de_compra_o_factura', 
vtiger_inventoryproductreltmpPurchaseOrder.fecha AS 
'PurchaseOrder_Fecha', vtiger_crmentity.crmid AS 
"PurchaseOrder_LBL_ACTION" from vtiger_purchaseorder inner join 
vtiger_crmentity on 
vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left join 
vtiger_inventoryproductrel as vtiger_inventoryproductreltmpPurchaseOrder
 on vtiger_purchaseorder.purchaseorderid = 
vtiger_inventoryproductreltmpPurchaseOrder.id left join 
vtiger_purchaseordercf on vtiger_purchaseorder.purchaseorderid = 
vtiger_purchaseordercf.purchaseorderid left join vtiger_groups on 
vtiger_groups.groupid = vtiger_crmentity.smownerid left join 
vtiger_users on <a href="http://vtiger_users.id" target="_blank">vtiger_users.id</a> = vtiger_crmentity.smownerid left join 
vtiger_vendor as vtiger_vendorRelPurchaseOrder on 
vtiger_vendorRelPurchaseOrder.vendorid = vtiger_purchaseorder.vendorid 
WHERE vtiger_purchaseorder.purchaseorderid > 0  AND 
vtiger_crmentity.deleted=0 and (( vtiger_inventoryproductrel.fecha 
BETWEEN '2021-01-12' AND '2021-01-12' ) ) LIMIT 0, 500::->Unknown 
column 'vtiger_inventoryproductrel.fecha' in 'where clause' <br></div><div><br></div><div>If I change manually 
vtiger_inventoryproductrel.fecha by 
vtiger_inventoryproductreltmpPurchaseOrde.fecha it works well.  

</div></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>
</blockquote>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>
</blockquote>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>
</blockquote></div>