vtiger.com - Home of vtiger CRM
Home Products Downloads Support Buy Support Partners Company  Community Forums Blogs   Extensions  
Call Us : +1 408-733-3229
 
Log in

Register | Forgot password ?
<<August 2010>>
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

 Search this forum

SourceForge.net Logo


Custom field displayed in List view (More Information tab) Bug Tracker | Installation | Webmail
Post new topic   Reply to topic  Forum Home -> Help - 5.0.4 Previous topic :: Next topic

Post  krem   Post subject: Custom field displayed in List view (More Information tab)
     Senior Member
Mon Apr 14, 2008 3:26 pm 
Posts: 162 
 
  Reply with quote
Hello,

I am trying to display a custom field in a list view, for exemple in an account, I want to add a column in the sales order view(More information tab).

To do so I have been trying to modify the saleorder.php file and add my custom field to the var $list_fields.

I think that I am unable to add the custom fields because of a formatting problem, does anybody know how to do it?


In SalesOrder.php, line 65 I added:
'Banned'=>Array('salesordercf'=>'cf_354'),
or
'Banned'=>Array('salesorder'=>'cf_354'),
or
'Banned'=>Array('salesorder'=>'Banned'),

and line 75:
'Banned'=>'cf_354',

This way worked in 4.2.3, does anybody could do it with 5.0.4?

Thanks,
Clem

    View user's profile Send private message

Post  krem   Post subject: Re: Custom field displayed in List view (More Information ta
     Senior Member
Fri Apr 25, 2008 1:02 pm 
Posts: 162 
 
  Reply with quote
I am still searching for a solution but found another forum post about it:
http://forums.vtiger.com/viewtopic.php?t=14923&amp;start=0

Still, I cannot find the way to display my custom field, a little help would be greatly appreciated

Bye

    View user's profile Send private message

Post  joebordes   Post subject: Re: Custom field displayed in List view (More Information ta
     Senior Member
Fri Apr 25, 2008 2:00 pm 
Posts: 2480 
Location: Alicante/Valencia, Spain 
  Reply with quote
Hi Clem,

Have a look at the getListQuery() function in include/utils/ListViewUtils.php
I think the SalesOrder query is missing "vtiger_salesordercf.*" in the field section of the query. The table IS in the from clause.

I looked at 5.0.3 and 5.0.1 and the code is the same so I suppose this didn't work in those versions either although I do find it strange I can't remember ever having tried it.

Try adding "vtiger_salesordercf.*" to the select and let us know how it turns out.

Regards, Joe
TSolucio

    View user's profile Send private message Visit poster's website

Post  krem   Post subject: Re: Custom field displayed in List view (More Information ta
     Senior Member
Sat Apr 26, 2008 4:11 pm 
Posts: 162 
 
  Reply with quote
Hi Joe,

Thanks to give me direction to search, I found it!

So far I think that vTiger 5.x doesn't use include/utils/ListViewUtils.php for related listviews but deal with it in each respective module.

In my case, I want to add a custom field to the saleorder list in an account. To do so I edited the file /modules/Accounts/Accounts.php

On line 525 you will find the function get_salesorder, in it, there is the query used to retrieve sale orders, and there is no mention of salesordercf.

I replaced

$query = "SELECT vtiger_crmentity.*,
vtiger_salesorder.*,
vtiger_quotes.subject AS quotename,
vtiger_account.accountname,
case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name
FROM vtiger_salesorder
INNER JOIN vtiger_crmentity
ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid
LEFT OUTER JOIN vtiger_quotes
ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid
LEFT OUTER JOIN vtiger_account
ON vtiger_account.accountid = vtiger_salesorder.accountid
LEFT JOIN vtiger_sogrouprelation
ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid
LEFT JOIN vtiger_groups
ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname
LEFT JOIN vtiger_users
ON vtiger_crmentity.smownerid = vtiger_users.id
WHERE vtiger_crmentity.deleted = 0
AND vtiger_salesorder.accountid = ".$id;
By

$query = "SELECT vtiger_crmentity.*,
vtiger_salesorder.*,
vtiger_salesordercf.*,
vtiger_quotes.subject AS quotename,
vtiger_account.accountname,
case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name
FROM vtiger_salesorder
INNER JOIN vtiger_crmentity
ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid
LEFT JOIN vtiger_salesordercf
ON vtiger_salesordercf.salesorderid = vtiger_salesorder.salesorderid
LEFT OUTER JOIN vtiger_quotes
ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid
LEFT OUTER JOIN vtiger_account
ON vtiger_account.accountid = vtiger_salesorder.accountid
LEFT JOIN vtiger_sogrouprelation
ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid
LEFT JOIN vtiger_groups
ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname
LEFT JOIN vtiger_users
ON vtiger_crmentity.smownerid = vtiger_users.id
WHERE vtiger_crmentity.deleted = 0
AND vtiger_salesorder.accountid = ".$id;

Now I can retrieve custom fields.

Thanks again Joe for you help,

Bye everybody

    View user's profile Send private message

Post  gawleyc   Post subject: Re: Custom field displayed in List view (More Information ta
     
Thu May 08, 2008 11:48 am 
Posts: 6 
 
  Reply with quote
Cant seem to get this working for vtiger CRM 5.0.3

I can get the heading up but cant seem to get the data to display.

I've tried editing both the ListViewUtils.php and also the contacts.php file but still no luck.

Any help would be very grateful Sad

    View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    vtiger Forum Index -> Help - 5.0.4 All times are GMT
Leave a Testimonial
Page 1 of 1

Jump to: