[Vtigercrm-developers] I must be missing something ...
Joe Bordes
joe at tsolucio.com
Sat Dec 22 14:31:21 PST 2007
Hi,
I haven't ran into this problem but it does look rather clear from your
exposition.
Get the table name from the vtiger_entityname table.
Joe
TSolucio
Andrew Rodes escribió:
>
> Ok, so I don’t remember this being broken, and I have scoured the
> forums to no avail.
>
>
>
> I am having a problem importing custom fields into accounts.
>
>
>
> I found the function where the problem is occurring, but its so
> blatent, I cant imagine I am correct.
>
>
>
> Basically, in CustomFieldUtil.php there is a function which is called
> during the import. The function is as follows:
>
>
>
> function getCustomFieldArray($module)
>
> {
>
> global $log;
>
> $log->debug("Entering getCustomFieldArray(".$module.")
> method ...");
>
> global $adb;
>
> * $custquery = "select * from vtiger_field where
> tablename='".$module."'";*
>
> $custresult = $adb->query($custquery);
>
> $custFldArray = Array();
>
> $noofrows = $adb->num_rows($custresult);
>
> for($i=0; $i<$noofrows; $i++)
>
> {
>
>
> $colName=$adb->query_result($custresult,$i,"column_name");
>
> $custFldArray[$colName] = $i;
>
> }
>
> $log->debug("Exiting getCustomFieldArray method ...");
>
> return $custFldArray;
>
>
>
> }
>
>
>
> However, on the line:
>
> *$custquery = "select * from vtiger_field where tablename='".$module."'";*
>
> * *
>
> the variable $module, always comes in as the expected “Accounts”
>
>
>
> However, in the vtiger_field table the values stored in the tablename
> column are all as expected such as: vtiger_account etc
>
>
>
> So this query returns NO custom fields for the module, and the import
> fails.(actually it returns success, but the record doesn’t show up in
> the ui since no custom field entries were made for it)
>
>
>
> ANY IDEAS? If not .. I will try to look for an elegant fix and share
> it (not sure where to get the table name for the given module .. sure
> its somewhere)
>
>
>
>
>
> Thanks,
>
>
>
> Andy
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Reach hundreds of potential candidates - http://jobs.vtiger.com
More information about the vtigercrm-developers
mailing list