• Martin Little
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
I'm getting the platform error described here when a trigger I have is being executed by a community member.  
https://success.salesforce.com/issues_view?id=a1p30000000E19wAAC

Apex error is below.  This trigger works fine from the salesforce web interface.  My understanding from the issue referenced at the above link is that ORA-00904 is a platform issue.

---------------------
Sandbox

Apex script unhandled trigger exception by user/organization: 00561000000Kj0n/00D4B000000CpdH
Source organization: 00D61000000agdX (null)
notifyChatterComments: execution of AfterInsert

caused by: System.UnexpectedException: common.exception.SfdcSqlException: ORA-00904: "T"."COMMUNITY_NICKNAME": invalid identifier


select /*FkJoin*/ "Id",
"Name",
"CommunityNickname"
from (select /*+ ordered use_hash(t) */
ids.num "ids_num",
t.entity_id "Id",
case when substr(t.entity_id,1,3) in ('003','00Q', '005') then trim(t.first_name || ' ' || t.last_name) when substr(t.entity_id,1,3) in ('01p','01q') then t.developer_name else nvl(t.name,trim(t.first_name || ' ' || t.last_name)) end "Name",
t.community_nickname "CommunityNickname"
from (select * from table(cast(? as id_num_array))) ids,
     (select /*+ ordered use_nl(nd) index(nd pkname_denorm) */
     nd.entity_id ids_num,
     nd.organization_id organization_id,
     nd.entity_id entity_id,
     nd.record_type_id,
     nd.name AS name,
          nd.first_name first_name,
     nd.last_name last_name,
     nd.middle_name middle_name,
     nd.preferred_address preferred_address,
     nd.suffix suffix,
     nd.deleted deleted,
     nd.active active,
     nd.archived archived,
     nullif(substr(nd.entity_id,1,3), '000'),
     nd.alias alias,
     nd.email email,
     nd.title title,
     nd.phone phone,
     nd.user_role_id user_role_id,
     nd.profile_id profile_id,
     nd.namespace_prefix namespace_prefix,
     nd.developer_name developer_name,
     nd.table_enum_or_id table_enum_or_id,
     nd.subtype subtype
     from (select * from table(cast(? AS ID_NUM_ARRAY))) tmp,
          core.name_denorm nd
     where (tmp.id = nd.entity_id)
     and (nd.organization_id = '00D4B000000CpdH')
     and (nd.entity_id != '000000000000000')
     and (nd.deleted = '0')
     UNION ALL
     (select /*+ ordered use_nl(t) index(t pkdashboard_component)) */
     t.dashboard_component_id ids_num,
     t.organization_id organization_id,
     t.dashboard_component_id entity_id,
     '' record_type_id,
     NVL(DECODE(t.component_type, 10, t.metric, t.title), 'Untitled Component') AS name,
     '' first_name,
     '' last_name,
     '' middle_name,
     '' preferred_address,
     '' suffix,
     '0' deleted,
     '1' active,
     '0' archived,
     nullif(substr(t.dashboard_component_id,1,3), '000'),
     '' alias,
     '' email,
     '' title,
     '' phone,
     '' user_role_id,
     '' profile_id,
     '' namespace_prefix,
     '' developer_name,
     '' table_enum_or_id,
     '' subtype
     from
(select * from table(cast(? AS ID_NUM_ARRAY))) tmp,
          core.dashboard_component t
     where (tmp.id = t.dashboard_component_id)
     and (substr(tmp.id,1,3) = '01a')
     and (t.organization_id = '00D4B000000CpdH')
)     UNION ALL
     (select /*+ ordered use_nl(t) index(t pkactivity)) */
     t.activity_id ids_num,
     t.organization_id organization_id,
     t.activity_id entity_id,
     '' record_type_id,
     t.subject AS name,
     '' first_name,
     '' last_name,
     '' middle_name,
     '' preferred_address,
     '' suffix,
     t.deleted deleted,
     '1' active,
     '0' archived,
     nullif(substr(t.activity_id,1,3), '000'),
     '' alias,
     '' email,
     '' title,
     '' phone,
     '' user_role_id,
     '' profile_id,
     '' namespace_prefix,
     '' developer_name,
     '' table_enum_or_id,
     '' subtype
     from
(select * from table(cast(? AS ID_NUM_ARRAY))) tmp,
          core.activity t
     where (tmp.id = t.activity_id)
     and (substr(tmp.id,1,3) = '00T')
     and (t.organization_id = '00D4B000000CpdH')
     and (t.deleted = '0'))     UNION ALL
     (select /*+ ordered use_nl(t) index(t pkactivity)) */
     t.activity_id ids_num,
     t.organization_id organization_id,
     t.activity_id entity_id,
     '' record_type_id,
     t.subject AS name,
     '' first_name,
     '' last_name,
     '' middle_name,
     '' preferred_address,
     '' suffix,
     t.deleted deleted,
     '1' active,
     '0' archived,
     nullif(substr(t.activity_id,1,3), '000'),
     '' alias,
     '' email,
     '' title,
     '' phone,
     '' user_role_id,
     '' profile_id,
     '' namespace_prefix,
     '' developer_name,
     '' table_enum_or_id,
     '' subtype
     from
(select * from table(cast(? AS ID_NUM_ARRAY))) tmp,
          core.activity t
     where (tmp.id = t.activity_id)
     and (substr(tmp.id,1,3) = '00U')
     and (t.organization_id = '00D4B000000CpdH')
     and (t.deleted = '0'))) t
where (ids.id = t.entity_id)
and (t.organization_id = '00D4B000000CpdH')
and (t.deleted = '0'))
order by "ids_num" asc nulls first

Trigger.notifyChatterComments: line 20, column 1