SQL View Name:contact_blg_rel_items
SQL View Number:5813
Group:Billing Manager
Base Table:contact
Description:Related billable items associated with a contact. Used by isupport/contact/blg_related_items_list.jsp JSP page
Flags:VIEW_OPTIMIZED 
Baseline/Custom:Baseline

Fields:

Field NameCommon TypeDatabase TypeGeneric Field IDArray SizeDefaultFlagsComment
contact_objidLONGint   DIRECT Contact internal record number 
devLONGint151  DIRECT Row version number for mobile distribution purposes 
idCHARvarchar 80  Billing Entity id 
item_subtype_idLONGint   DIRECT The subtype id for paymeans bank account or credit card 
item_type_idLONGint   DIRECT The type id for the defined object. 
nameCHARvarchar 80  Billing Entity Name 
objidLONGint3  DIRECT Billing Entity Objid 
role_nameCHARvarchar 80  Role contact is playing for billing entity 
role_objidLONGint   DIRECT Role internal record number 

SQL:

((select
173 as item_type_id,
0 as item_subtype_id,
tb.objid as objid,
tb.name as name,
tb.org_id as id,
tcr.role_name as role_name,
tcr.objid as role_objid,
tcr.contact_role2contact as contact_objid,
tcr.dev as dev
from table_bus_org tb, table_contact_role tcr, table_site ts, table_bus_site_role tbs
where ts.objid=tbs.bus_site_role2site
and tb.objid=tbs.bus_site_role2bus_org
and tb.blg_enabled_ind = 1
and ts.objid = tcr.contact_role2site)
union
(select
5694 as item_type_id,
1 as item_subtype_id,
tf.objid as objid,
tf.name as name,
' ' as id,
tc.role_name as role_name,
tc.objid as role_objid,
tc.con_accnt_role2contact as contact_objid,
tc.dev as dev
from table_fin_accnt tf, table_con_fin_accnt_role tc
where tf.objid = tc.fin_accnt_role2fin_accnt)
union
(select
5695 as item_type_id,
2 as item_subtype_id,
tb.objid as objid,
tb.name as name,
' ' as id,
tc.role_name as role_name,
tc.objid as role_objid,
tc.con_role2contact as contact_objid,
tc.dev as dev
from table_blg_argmnt tb, table_con_blg_argmnt_role tc
where tb.objid = tc.ba_role2blg_argmnt)
union
(select
5752 as item_type_id,
3 as item_subtype_id,
tp.objid as objid,
tp.name as name,
' ' as id,
tc.role_name as role_name,
tc.objid as role_objid,
tc.con_ppb_role2contact as contact_objid,
tc.dev as dev
from table_pp_bucket tp, table_con_ppb_role tc
where tp.objid = tc.con_ppb_role2pp_bucket)
union
(select
5440 as item_type_id,
4 as item_subtype_id,
tp.objid as objid,
tp.cc_type as name,
tp.last_four as id,
tc.role_name as role_name,
tc.objid as role_objid,
tc.cn_pm_role2contact as contact_objid,
tc.dev as dev
from table_pay_means tp, table_con_pym_role tc
where tp.means_type = 0
and tp.objid = tc.cn_pm_role2pay_means)
union
(select
5440 as item_type_id,
5 as item_subtype_id,
tp.objid as objid,
tp.bank_name as name,
tp.last_four as id,
tc.role_name as role_name,
tc.objid as role_objid,
tc.cn_pm_role2contact as contact_objid,
tc.dev as dev
from table_pay_means tp, table_con_pym_role tc
where tp.means_type = 2
and tp.objid = tc.cn_pm_role2pay_means))
My Recent Objects
contact_blg_rel_items