AnsweredAssumed Answered

Email Subpanel on Tasks

Question asked by Kenneth Brill on Sep 27, 2017
Latest reply on Sep 27, 2017 by Kenneth Brill

I added a relationship to Activities to Tasks, so now I have an Email subpanel that SEEMS to work fine.  But I have noticed that the only emails it shows on the subpanel is the current users email, if the email is assigned to anyone else it is not shown.  Is there a way to make it show all emails regardless of who they are assigned to?

 

This is the query it is running, at the bottom you see the assigned_user_id in the WHERE clause

SELECT DISTINCT
    emails.name NAME,
    emails.status STATUS,
    emails.date_entered date_entered,
    emails.date_modified date_modified,
    jt0_assigned_user_link.first_name rel_assigned_user_name_first_name,
    jt0_assigned_user_link.last_name rel_assigned_user_name_last_name,
    jt0_assigned_user_link.created_by assigned_user_name_owner,
    emails.assigned_user_id assigned_user_id,
    emails.id id,
    emails.created_by created_by
FROM
    emails
LEFT JOIN
    users jt0_assigned_user_link
ON
    (
        emails.assigned_user_id = jt0_assigned_user_link.id AND jt0_assigned_user_link.deleted = 0
    )
LEFT JOIN
    users_cstm jt0_assigned_user_link_cstm
ON
    (
        jt0_assigned_user_link_cstm.id_c = jt0_assigned_user_link.id
    )
INNER JOIN
    emails_beans jt2_emails_beans
ON
    (
        emails.id = jt2_emails_beans.email_id AND jt2_emails_beans.deleted = 0 AND jt2_emails_beans.bean_module = 'Tasks'
    )
INNER JOIN
    tasks jt1_tasks_activities_1_emails
ON
    (
        jt1_tasks_activities_1_emails.id = jt2_emails_beans.bean_id AND jt1_tasks_activities_1_emails.deleted = 0 AND jt1_tasks_activities_1_emails.id = 'a7b7eab2-9fb6-11e7-970e-4c3275944661'
    )
LEFT JOIN
    tasks_cstm jt1_tasks_activities_1_emails_cstm
ON
    (
        jt1_tasks_activities_1_emails_cstm.id_c = jt1_tasks_activities_1_emails.id
    )
WHERE
    emails.deleted = 0 AND emails.assigned_user_id = '0b069d40-2b7f-11e7-b49b-52d504b662cb'
ORDER BY
    emails.date_modified
DESC
    ,
    emails.id
DESC
LIMIT 0, 11

Outcomes