Results 1 to 1 of 1

Thread: Error custom subpanel show

  1. #1
    SugarTalk.ru is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Ukraine
    Posts
    36

    Default Error custom subpanel show

    Hello.
    I add my custom module and add subpanel to module contacts.
    And when I go to detail view of contact i see next error:
    "Error running count query for Contact List: Query Failed. You have an error in your SQL syntax
    ( SELECT count(*) c FROM tasks where ( tasks.contact_id= '0c7fdb9c-4c4b-11df-8149-9fdd75b11a6f' AND tasks.deleted=0 AND (tasks.status='Completed' OR tasks.status='Deferred')) AND tasks.deleted=0 ) UNION ALL ( SELECT count(*) c FROM meetings INNER JOIN meetings_contacts ON (meetings.id=meetings_contacts.meeting_id AND meetings_contacts.contact_id= '0c7fdb9c-4c4b-11df-8149-9fdd75b11a6f') where ( meetings_contacts.deleted=0 AND meetings.deleted=0 AND (meetings.status='Held' OR meetings.status='Not Held')) AND meetings.deleted=0 ) UNION ALL ( SELECT count(*) c FROM calls INNER JOIN calls_contacts ON (calls.id=calls_contacts.call_id AND calls_contacts.contact_id= '0c7fdb9c-4c4b-11df-8149-9fdd75b11a6f') where ( calls_contacts.deleted=0 AND calls.deleted=0 AND (calls.status='Held' OR calls.status='Not Held')) AND calls.deleted=0 ) UNION ALL UNION ALL ( SELECT count(*) c FROM emails INNER JOIN emails_beans ON (emails.id=emails_beans.email_id AND emails_beans.bean_id= '0c7fdb9c-4c4b-11df-8149-9fdd75b11a6f' AND bean_module='Contacts') where ( emails_beans.deleted=0 AND emails.deleted=0) AND emails.deleted=0 ) UNION ALL ( SELECT count(*) c FROM emails JOIN (select distinct email_id from emails_email_addr_rel eear join email_addr_bean_rel eabr on eabr.bean_id ='0c7fdb9c-4c4b-11df-8149-9fdd75b11a6f' and eabr.bean_module = 'Contacts' and eabr.email_address_id = eear.email_address_id and eabr.deleted=0 where eear.deleted=0 and eear.email_id not in (select eb.email_id from emails_beans eb where eb.bean_module ='Contacts' and eb.bean_id = '0c7fdb9c-4c4b-11df-8149-9fdd75b11a6f' and eb.deleted=0) ) derivedemails on derivedemails.email_id = emails.id where emails.deleted=0 )

    Error in because UNION ALL UNION ALL in SQL query.

    But after i write hide subpanel after login in config. I show closed subpanels and i can open my subpanel or any other subpanel without any error.

    Help me please.
    I wouldn't like the default to hide subpanels.

    layout_defs
    $layout_defs['Contacts']['subpanel_setup']['cmessengers'] =
    array(
    'order' => 99,
    'module' => 'Cmessengers',
    'subpanel_name' => 'forContacts',
    'get_subpanel_data' => 'im_contact_link',
    'title_key' => 'LBL_MESSENGERS_SUBPANEL_TITLE',
    'top_buttons' => array(
    array(
    'widget_class' => 'SubPanelTopButtonQuickCreate',
    ),
    array(
    'widget_class' => 'SubPanelTopSelectButton',
    'mode'=>'MultiSelect',
    'popup_module' => 'Cmessengers',
    ),
    ),
    );
    vardefs
    $dictionary['Contact']['relationships']['contact_to_ims'] =
    array(
    'lhs_module' => 'Contacts',
    'lhs_table' => 'contacts',
    'lhs_key' => 'id',
    'rhs_module' => 'Cmessengers',
    'rhs_table' => 'cmessengers',
    'rhs_key' => 'parent_id',
    'relationship_type' => 'one-to-many',
    'relationship_role_column' => 'parent_type',
    'relationship_role_column_value' => 'Contacts',
    );

    $dictionary['Contact']['fields']['im_contact_link'] =
    array (
    'name' => 'im_contact_link',
    'type' => 'link',
    'relationship' => 'contact_to_ims',
    'source' => 'non-db',
    'vname' => 'LBL_IM_CONTACT_LINK',
    );
    Last edited by SugarTalk.ru; 2010-06-30 at 01:45 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 2009-12-04, 04:53 PM
  2. how to let relate account show in subpanel show
    By eddiechen in forum Developer Help
    Replies: 2
    Last Post: 2009-02-20, 01:39 AM
  3. Can't show subpanel in 4.5.1
    By farid in forum Developer Help
    Replies: 0
    Last Post: 2008-12-23, 10:15 AM
  4. custom subpanel error
    By JVWay in forum Developer Help
    Replies: 0
    Last Post: 2008-06-06, 07:09 PM
  5. My subpanel won't show!!
    By smcafee in forum Developer Help
    Replies: 2
    Last Post: 2006-03-02, 09:22 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
  •