SQL View Name:contact_work
SQL View Number:5847
Group:CIM
Base Table:contact
Description:View for CIM contact work: case, subcase, lit request, sales quote, order, action item, opportuntiy, and dialogue. Used in contact_work_tab_html_inc.jsp JSP page
Flags:VIEW_OPTIMIZED 
Baseline/Custom:Baseline

Fields:

Field NameCommon TypeDatabase TypeGeneric Field IDArray SizeDefaultFlagsComment
contact_objidLONGint   DIRECT Internal record number for contact 
idCHARvarchar4255  ID number of the object 
itm_objidLONGint3  DIRECT Internal record number of various objects 
modify_stmpCLK_TIMEdatetime48   The date and time when object was last saved 
statusCHARvarchar 30  Status of object 
sub_typeLONGtinyint   DIRECT sub-type of the object (i.e, 1=quote, 4=order) 
titleCHARvarchar280  Title of the object 
typeLONGint   DIRECT type of the object (i.e 0=case, 45=contact, etc.) 

SQL:

(
select
ca.case_reporter2contact as contact_objid,
ca.objid as itm_objid,
ca.modify_stmp as modify_stmp,
0 as type,
-1 as sub_type,
ca.id_number as id,
ca.title as title,
g.title as status
from
table_case ca,
table_gbst_elm g
where
ca.casests2gbst_elm=g.objid
union
select
ca.case_reporter2contact as contact_objid,
s.objid as itm_objid,
s.modify_stmp as modify_stmp,
24 as type,
-1 as sub_type,
s.id_number as id,
s.title as title,
g.title as status
from
table_case ca,
table_subcase s,
table_gbst_elm g
where
s.subcase2case=ca.objid and
s.subc_casests2gbst_elm = g.objid
union
select
cr.contact_role2contact as contact_objid,
l.objid as itm_objid,
l.create_date as modify_stmp,
5309 as type,
-1 as sub_type,
l.lit_req_id as id,
l.title as title,
g.title as status
from
table_contact_role cr,
table_lit_ship_req lsr,
table_lit_req l,
table_gbst_elm g
where
cr.objid=lsr.lit_ship2contact_role and
l.objid=lsr.lit_ship_req2lit_req and
l.lit_status2gbst_elm=g.objid
union
select
co.primary2contact as contact_objid,
co.objid as itm_objid,
co.last_update as modify_stmp,
86 as type,
co.struct_type as sub_type,
co.id as id,
co.title as title,
g.title as status
from
table_contract co,
table_gbst_elm g
where
(co.struct_type=1 or co.struct_type=4) and
co.status2gbst_elm=g.objid
union
select
t.task2contact as contact_objid,
t.objid as itm_objid,
t.update_stamp as modify_stmp,
5080 as type,
-1 as sub_type,
t.task_id as id,
t.title as title,
g.title as status
from
table_task t,
table_gbst_elm g
where
t.task_sts2gbst_elm=g.objid
union
select
cr.opp_role2contact as contact_objid,
o.objid as itm_objid,
o.update_stamp as modify_stmp,
5000 as type,
-1 as sub_type,
o.id as id,
o.name as title,
g.title as status
from
table_con_opp_role cr,
table_opportunity o,
table_gbst_elm g
where
o.objid=cr.con_role2opportunity and
o.opp_sts2gbst_elm=g.objid
union
select
intrxn2contact as contact_objid,
d.objid as itm_objid,
d.last_update as modify_stmp,
5200 as type,
-1 as sub_type,
d.id_number as id,
d.title as title,
g.title as status
from
table_intrxn i,
table_intrxncmcn ic,
table_communication co,
table_dialogue d,
table_gbst_elm g
where
i.objid=ic.cmcn2intrxn and
co.objid=ic.intrxn2communication and
d.objid=co.communication2dialogue and
d.dialogue_sts2gbst_elm=g.objid
)
My Recent Objects
contact_work