RSF_TR_COMP_VW

(SQL View)
Index Back

Companies in a territory

Companies in a territory. Used by Mobile Sales.

SELECT TR.TREE_NAME ,TR.TERRITORY_ID ,TR.EFFDT ,TR.PERSON_ID ,O.OPRID ,TR.PRIMARY_USER ,B.BO_ID ,B.BO_TYPE_ID ,T.BUSINESS_UNIT ,T.MARKET ,T.ASSIGN_GROUP ,C.SYNCID ,C.SYNCDTTM FROM PS_RSF_TR_TEAM TR , PS_RSF_TR_CRIT_VAL A , PS_BO B , PS_RD_COMPANY C , PSOPRALIAS O , PS_RSF_TERRITORY T WHERE A.EFFDT = TR.EFFDT AND A.CONFIG_CRITERIA_CD= '1' AND A.TREE_NAME=TR.TREE_NAME AND A.TERRITORY_ID=TR.TERRITORY_ID AND A.TREE_NAME=T.TREE_NAME AND A.TERRITORY_ID=T.TERRITORY_ID AND A.CRITERIA_VALUE_NUM = B.BO_ID AND B.BO_TYPE_ID=2 AND B.BO_ID=C.BO_ID AND TR.PERSON_ID=O.PERSON_ID AND TR.EFFDT = ( SELECT MAX(Y.EFFDT) FROM PS_RSF_TR_TEAM Y WHERE Y.TREE_NAME = TR.TREE_NAME AND Y.TERRITORY_ID = TR.TERRITORY_ID AND Y.EFFDT <= %CurrentDateIn AND TR.PERSON_ID <> ' ' )

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 TREE_NAME Character(18) VARCHAR2(18) NOT NULL Tree Name
2 TERRITORY_ID Character(20) VARCHAR2(20) NOT NULL Territory ID
3 EFFDT Date(10) DATE Effective Date

Default Value: %date

4 PERSON_ID Character(15) VARCHAR2(15) NOT NULL Person ID

Prompt Table: RSF_SUSER_A_VW

5 OPRID Character(30) VARCHAR2(30) NOT NULL A user's ID (see PSOPRDEFN).
6 PRIMARY_USER Character(1) VARCHAR2(1) NOT NULL Primary Sales User

Y/N Table Edit

Default Value: N

7 BO_ID Signed Number(32,0) DECIMAL(31) NOT NULL Business Object ID
8 BO_ROLE_TYPE_ID Number(12,0) DECIMAL(12) NOT NULL BO_ROLE_TYPE_ID
9 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit
10 MARKET Character(3) VARCHAR2(3) NOT NULL Market
11 ASSIGN_GROUP Character(30) VARCHAR2(30) NOT NULL This field is used to specify assignment group name for Territory assignment.
12 SYNCID Number(10,0) DECIMAL(10) NOT NULL The Synchronization ID field stores a value generated by the sync processor. The value is used to identify the type of object that the sync processor is about to handle.
13 SYNCDTTM DateTime(26) TIMESTAMP Synchronization Last Update Date Time