Results 1 to 8 of 8

Thread: Not having luck with custom field inside activities module

  1. #1
    Thyssen is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    38

    Default Not having luck with custom field inside activities module

    Inside of my opportunities section I have a subpanel called activities. Activies displays tasks, meeting, call, and email information which I am certain all of you have seen:



    But notice the Mtg Objective column in this sub panel? This is a custom field that I am trying to add which is pertinent information for a meeting. It is a custom field mtg_objective_c.

    I have added information inside of modules\Meetings\metadata\subpanels\ForActivities. php as well as
    modules/Act/metadata/subpaneldefs.php.

    Inside of : modules/Act/metadata/subpaneldefs.php

    I have this:
    array(
    'name' => 'mtg_objective_c',
    'vname' => 'LBL_MTG_OBJECTIVE',
    'width' => '30%',
    'module' => 'Meetings',
    'force_exists' => true,
    ),

    And inside of modules\Meetings\metadata\subpanels\ForActivities. php I have this:

    'mtg_objective_c'=>array(
    'vname' => 'LBL_MTG_OBJECTIVE',
    'name' => 'mtg_objective_c',
    'width' => '30%',
    'dbType' => 'varchar',
    'force_exists'=>true,
    ),

    I have done an admin repair and rebuild and the column Mtg Objective is displayed but no data is being displayed. I know there is data there because if I go into a meeting I see the meeting objective:



    I tried posting in the developers forum as well and I've searched the forum and found posts related to this but they are all dead end posts (people don't get an answer, or people just keep bumping the threads with no answers). Please if anyone knows how to do this I would appreciate some help. Something that seems so simple like this should of taken me 5 minutes, instead I've been searching and trying for 2 days!

  2. #2
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Not having luck with custom field inside activities module

    I don't see the specific cause of your data not showing up, but all modules that contribute data to the Activities subpanel must have the same list of fields. So to prevent a variety of problems, you would need to make similar edits to ForActivities.php under tasks, meetings, calls, and email modules.

    Also directly editing ForActivities.php is not upgrade safe. You will lose these changes as soon as you update Sugar.

    To do this right you would need to create a new file patterned after ForActivities.php, but with a unique name that would not be overwritten by the update process, then create an Extension that refers to these new subpanel file names.

    I did a similar thing to change what date fields showed up under the History subpanel and wrote up all the steps in the thread http://www.sugarcrm.com/forums/showthread.php?t=55691. I was similarly frustrated by the lack of (detaiiled) responses, so I explained **everything** I did and what happened. So it is painfully long, but it is complete and gives reasons. Take a look and it might give you some ideas.

    Phil

  3. #3
    Thyssen is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    38

    Default Re: Not having luck with custom field inside activities module

    Quote Originally Posted by datasponge View Post
    I don't see the specific cause of your data not showing up, but all modules that contribute data to the Activities subpanel must have the same list of fields. So to prevent a variety of problems, you would need to make similar edits to ForActivities.php under tasks, meetings, calls, and email modules.

    Also directly editing ForActivities.php is not upgrade safe. You will lose these changes as soon as you update Sugar.

    To do this right you would need to create a new file patterned after ForActivities.php, but with a unique name that would not be overwritten by the update process, then create an Extension that refers to these new subpanel file names.

    I did a similar thing to change what date fields showed up under the History subpanel and wrote up all the steps in the thread http://www.sugarcrm.com/forums/showthread.php?t=55691. I was similarly frustrated by the lack of (detaiiled) responses, so I explained **everything** I did and what happened. So it is painfully long, but it is complete and gives reasons. Take a look and it might give you some ideas.

    Phil
    Thanks for at least responding ...

    However If I add this:

    'mtg_objective_c'=>array(
    'vname' => 'LBL_MTG_OBJECTIVE',
    'name' => 'mtg_objective_c',
    'target_module' => 'Meetings',
    'width' => '30%',
    'type' => 'varchar',
    'force_exists'=>true,
    ),


    To say Calls\metadata\subpanels\ForActivities.php and then go to a specific opportunity, Sugar throws an error right when it reaches that sub panel and says this:

    SQL Error : All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists

    So now Im not even seeing the subpanel. I tried adding it to all tasks, emails, calls, and meetings and repair and rebuild with the same result.

    So then I tried doing it to say just Calls, and I get that error.

    Any other ideas?

  4. #4
    Thyssen is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    38

    Default Re: Not having luck with custom field inside activities module

    I removed :

    force_exists=true

    so that it becomes:

    'mtg_objective_c'=>array(
    'vname' => 'LBL_MTG_OBJECTIVE',
    'name' => 'mtg_objective_c',
    'target_module' => 'Meetings',
    'width' => '30%',
    'type' => 'varchar',
    ),

    I did that for calls, tasks, and meetings.

    I then went into Emails\metadata\subpanels

    and noticed there was no ForActivities.php file, so I just made a copy of the ForActivities from one of the other modules (Calls) and copied it for emails. I did a repair and rebuild and then I went to an opportunity and again I see the Mtg Objective column but absolutely NO DATA whatsoever.

    Is there any other file I need to edit to map this custom field to the activities sub panel.
    Please anyone out there, maybe a Sugar Professional or someone specifically from SugarCRM to help with this?

  5. #5
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Not having luck with custom field inside activities module

    Just for kicks can you try a non-custom field instead? If that works then maybe it just isn't set up to support custom fields.

  6. #6
    Thyssen is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    38

    Default Re: Not having luck with custom field inside activities module

    Quote Originally Posted by eggsurplus View Post
    Just for kicks can you try a non-custom field instead? If that works then maybe it just isn't set up to support custom fields.
    Wow strange this works:

    'description'=>array(
    'vname' => 'LBL_DESCRIPTION',
    'name' => 'description',
    'target_module' => 'Meetings',
    'width' => '30%',
    'type' => 'varchar',
    ),

    And its not a custom field. Could it be possible that the activities subpanel does not take custom fields?
    Surely someone has done this????

  7. #7
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Not having luck with custom field inside activities module

    Quote Originally Posted by Thyssen View Post
    And its not a custom field. Could it be possible that the activities subpanel does not take custom fields?
    Surely someone has done this????
    I don't have a definitive answer, but I saw posts that said custom fields do NOT work in subpanels. That was one reason I chose to add my note_date field using a vardefs extension rather than through studio.

    So if you need to show the field mtg_objective, you can create it by adding its definition lines to custom/Extension/modules/Meetings/Ext/Vardefs/custom_fields.php. That will create it in the main table rather than the cstm table and will not add the _c to the end. This is what I did to successfully to display my note_date field in the history subpanel.

    Phil

  8. #8
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Not having luck with custom field inside activities module

    Quote Originally Posted by Thyssen View Post
    I removed :

    force_exists=true

    so that it becomes:

    'mtg_objective_c'=>array(
    'vname' => 'LBL_MTG_OBJECTIVE',
    'name' => 'mtg_objective_c',
    'target_module' => 'Meetings',
    'width' => '30%',
    'type' => 'varchar',
    ),

    I did that for calls, tasks, and meetings.

    I then went into Emails\metadata\subpanels

    and noticed there was no ForActivities.php file, so I just made a copy of the ForActivities from one of the other modules (Calls) and copied it for emails. I did a repair and rebuild and then I went to an opportunity and again I see the Mtg Objective column but absolutely NO DATA whatsoever.

    Is there any other file I need to edit to map this custom field to the activities sub panel.
    Please anyone out there, maybe a Sugar Professional or someone specifically from SugarCRM to help with this?
    I saw in another topic the use of the table element. You might try that here as:

    PHP Code:
            'mtg_objective_c'=>array(
                
    'vname' => 'LBL_MTG_OBJECTIVE',
                
    'name' => 'mtg_objective_c',
                
    'table' => 'meetings_cstm',
                
    'target_module' => 'Meetings',
                
    'width' => '30%',
                
    'type' => 'varchar',
            ), 
    Phil

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Field inside activities sub panel does not show data
    By Thyssen in forum Developer Help
    Replies: 2
    Last Post: 2010-01-25, 12:29 PM
  2. Replies: 0
    Last Post: 2009-01-15, 08:35 AM
  3. add new custom tabs inside a module
    By whiteFwolf in forum Developer Help
    Replies: 0
    Last Post: 2008-09-01, 11:18 AM
  4. custom activities in the activities module
    By danikun in forum Developer Help
    Replies: 1
    Last Post: 2008-07-11, 10:42 AM
  5. Large amounts of information inside a single custom module
    By dsmithies in forum Developer Help
    Replies: 5
    Last Post: 2008-03-27, 12:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •