SQL View Name:contact_related_items
SQL View Number:5751
Group:Support
Base Table:contact
Description:Related queueable items associated with a contact
Flags:VIEW_OPTIMIZED 
Baseline/Custom:Baseline

Fields:

Field NameCommon TypeDatabase TypeGeneric Field IDArray SizeDefaultFlagsComment
contact_objidLONGint   DIRECT Contact internal record number 
creation_dateCLK_TIMEdatetime48   The date and time the object was created 
devLONGint151  DIRECT Row version number for mobile distribution purposes 
idCHARvarchar4255  Unique id assigned based on auto-numbering definition 
itm_objidLONGint   DIRECT The objid for the defined object. 
objidLONGint3  DIRECT Case internal record number 
ownerCHARvarchar 30  User login name 
statusCHARvarchar 30  Status of object. 
struct_typeLONGtinyint   DIRECT The struct_type from Contracts table. 
titleCHARvarchar280  Case or service call title; summary of case details 
typeCHARvarchar 80  Type of object. ie. Case, Contract/Quote/Order, Opportunity, etc. 

SQL:

((select 'Case' as type, table_case.objid, 0 as itm_objid,
table_case.modify_stmp as creation_date, table_gbst_elm.title as status,
table_case.title, table_case.id_number as id, table_user.login_name as owner,
table_contact.objid as contact_objid, -1 as struct_type, table_case.dev from table_case,
table_user, table_contact, table_gbst_elm
where (table_contact.objid = table_case.case_reporter2contact
OR table_contact.objid = table_case.alt_contact2contact)
AND table_gbst_elm.objid = table_case.casests2gbst_elm
AND table_user.objid = table_case.case_owner2user)
union
(select 'Contract/Quote/Order' as type, table_contract.objid,
86 as itm_objid, table_contract.create_dt as creation_date,
table_gbst_elm.title as status, table_contract.title, table_contract.id as id,
table_user.login_name as owner, table_contact.objid as contact_objid,
table_contract.struct_type as struct_type, table_contract.dev from table_contract,
table_user, table_contact, table_gbst_elm where table_contact.objid = table_contract.primary2contact
AND table_gbst_elm.objid = table_contract.status2gbst_elm
AND table_user.objid = table_contract.owner2user)
union
(select 'Opportunity' as type, table_opportunity.objid,
5000 as itm_objid, table_opportunity.update_stamp as creation_date,
table_gbst_elm.title as status, table_opportunity.name as title, table_opportunity.id,
table_user.login_name as owner, table_contact.objid as contact_objid, -1 as struct_type,
table_opportunity.dev from table_opportunity, table_user, table_contact,
table_con_opp_role, table_gbst_elm
where table_contact.objid = table_con_opp_role.opp_role2contact
AND table_opportunity.objid = table_con_opp_role.con_role2opportunity
AND table_user.objid = table_opportunity.opp_owner2user
AND table_gbst_elm.objid = table_opportunity.opp_sts2gbst_elm)
union
(select 'Subcase' as type, table_subcase.objid, 24 as itm_objid,
table_subcase.modify_stmp as creation_date, table_gbst_elm.title as status,
table_subcase.title, table_subcase.id_number as id, table_user.login_name as owner,
table_contact.objid as contact_objid, -1 as struct_type, table_subcase.dev
from table_subcase, table_case, table_user, table_contact, table_gbst_elm
where (table_contact.objid = table_case.case_reporter2contact
OR table_contact.objid = table_case.alt_contact2contact)
AND table_gbst_elm.objid = table_subcase.subc_casests2gbst_elm
AND table_user.objid = table_subcase.subc_owner2user
AND table_case.objid = table_subcase.subcase2case)
union
(select 'Action Item' as type, table_task.objid, 5080 as itm_objid,
table_task.update_stamp as creation_date, table_gbst_elm.title as status,
table_task.title, table_task.task_id as id, table_user.login_name as owner,
table_contact.objid as contact_objid, -1 as struct_type, table_task.dev
from table_task, table_user, table_contact, table_gbst_elm
where table_contact.objid = table_task.task2contact
AND table_gbst_elm.objid = table_task.task_sts2gbst_elm
AND table_user.objid = table_task.task_owner2user)
union
(select 'Interaction' as type, table_interact.objid, 5225 as itm_objid,
table_interact.create_date as creation_date, '' as status, table_interact.title,
table_interact.interact_id as id, table_interact.agent as owner,
table_contact.objid as contact_objid, -1 as struct_type, table_interact.dev
from table_interact, table_contact
where table_contact.objid = table_interact.interact2contact)
union
(select 'Interaction' as type, table_intrxn.objid, 5830 as itm_objid,
table_intrxn.start_time as creation_date, '' as status, table_intrxn.title,
'' as id, '' as owner, table_contact.objid as contact_objid, -1 as struct_type,
table_intrxn.dev from table_intrxn, table_contact
where table_contact.objid = table_intrxn.intrxn2contact))
My Recent Objects
contact_related_items