SQL View Name:account_work
SQL View Number:5851
Group:CIM
Base Table:bus_org
Description:View for CIM account work: case, subcase, lit request, sales quote, order, action item, and opportuntiy. Used in account_work_tab_html_inc.jsp JSP page
Flags:VIEW_OPTIMIZED 
Baseline/Custom:Baseline

Fields:

Field NameCommon TypeDatabase TypeGeneric Field IDArray SizeDefaultFlagsComment
account_objidLONGint   DIRECT Internal record number for account 
devLONGint151  DIRECT Row version number for mobile distribution purposes 
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
s.primary2bus_org as account_objid,
c.objid as itm_objid,
c.modify_stmp as modify_stmp,
0 as type,
-1 as sub_type,
c.id_number as id,
c.title as title,
g.title as status,
-1 as dev
from
table_site s,
table_case c,
table_gbst_elm g
where
s.objid=c.case_reporter2site and
c.casests2gbst_elm=g.objid
union
select
s.primary2bus_org as account_objid,
sc.objid as itm_objid,
sc.modify_stmp as modify_stmp,
24 as type,
-1 as sub_type,
sc.id_number as id,
sc.title as title,
g.title as status,
-1 as dev
from
table_site s,
table_case c,
table_subcase sc,
table_gbst_elm g
where
s.objid=c.case_reporter2site and
c.objid=sc.subcase2case and
sc.subc_casests2gbst_elm=g.objid
union
select
lsr.lit_ship_req2bus_org as account_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,
-1 as dev
from
table_lit_ship_req lsr,
table_lit_req l,
table_gbst_elm g
where
lsr.lit_ship_req2lit_req=l.objid and
l.lit_status2gbst_elm=g.objid
union
select
c.sell_to2bus_org as account_objid,
c.objid as itm_objid,
c.last_update as modify_stmp,
86 as type,
c.struct_type as sub_type,
c.id as id,
c.title as title,
g.title as status,
-1 as dev
from
table_contract c,
table_gbst_elm g
where
(c.struct_type=1 or c.struct_type=4) and
c.status2gbst_elm=g.objid
union
select
t.task_for2bus_org as account_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,
-1 as dev
from
table_task t,
table_gbst_elm g
where
t.task_sts2gbst_elm=g.objid
union
select
bor.bus_role2bus_org as account_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,
-1 as dev
from
table_bus_opp_role bor,
table_opportunity o,
table_gbst_elm g
where
o.objid=bor.opp_role2opportunity and
o.opp_sts2gbst_elm=g.objid
)
My Recent Objects
account_work