          SUBROUTINE (FKEY,CLASS.NAME,ACTIVE.ID.DATA, FORM.ID, KEY.ID, ERR.MSG)
** Version# 4.0001[1] - 04/27/2014 - 11:52pm - TSMITH - eclipse
*** Subroutine - JAVA.UD.SCREEN.GET
*-------------------------------------------------------------------------*
*** This routine retrives the UD screen assiged to the F Key used.
*** This will also return the primary key index to the UD Screen.
*-------------------------------------------------------------------------*
*** FKEY           -  F Key used to access the screen. This is how [IN]
***                   we determine which UD Screen to open
*** CLASS.NAME     -  The parent screen that the user is trying to [IN]
***                   open a UD Screen from.
*** ACTIVE.ID.DATA -  This is an AM delimted list of ID:VM:VALUE   [IN]
***                   pairs. The ids map to the constants in
***                   ActiveIDList.java
*** FORM.ID        -  ID of the UD Screen                          [OUT]
*** KEY.ID         -  Primary Key for the Screen                   [OUT]
*** ERR.MSG        -  Any error messages generated                 (OUT)
*-------------------------------------------------------------------------*
*** Common Variables Used:
*** None
*-------------------------------------------------------------------------*

          SCRN.ID = ''
          SOLAR.UD.FIND.SCREEN CLASS.NAME,ACTIVE.ID.DATA,SCRN.ID

             IF SCRN.ID = '' THEN
                ERR.MSG = 'No UD screen Assigned!'
                RETURN
             END
             ** set up oid.data$
             JAVA.BUILD.OID.DATA ACTIVE.ID.DATA
             READ SCRNS FROM WORKFILE,'SCRN~':SCRN.ID ELSE SCRNS = ''
             FORM.ID = SCRNS<1,FKEY>
             IF FORM.ID = '' THEN
                ERR.MSG = 'No UD screen Assigned!'
                RETURN
             END ELSE
               IF ERR.MSG THEN RETURN
             END
             PRI.NO  = SCRNS<2,FKEY>
             WRITE OID.DATA$ ON CTRLFILE,'EJO'
             BEGIN CASE
             CASE PRI.NO = 1;         PRI.ID = OID.DATA$<1>;  * OID
             CASE PRI.NO = 2;
                READV WRK FROM LEDFILE,OID.DATA$<1>,1 ELSE WRK = ''
                GEN = OID.DATA$<2>; IF GEN < 1 THEN GEN = 1
                PRI.ID = WRK<1,GEN>
             CASE PRI.NO = 3;
                READV WRK FROM LEDFILE,OID.DATA$<1>,5 ELSE WRK = ''
                GEN = OID.DATA$<2>; IF GEN < 1 THEN GEN = 1
                PRI.ID = WRK<1,GEN>
             CASE PRI.NO = 4;
                LD.READV PRI.ID, OID.DATA$<1>, OID.DATA$<3>, 1
             CASE PRI.NO = 5;         PRI.ID = OID.DATA$<4>;  * CN
             CASE PRI.NO = 6;         PRI.ID = OID.DATA$<5>;  * PN
             CASE PRI.NO = 8;         PRI.ID = ''
             CASE PRI.NO = 9;
                PRI.ID = OID.DATA$<1>:"~":OID.DATA$<3>
             CASE PRI.NO = 10;
             NAME = TRANS('ENTITY',OID.DATA$<4>,1,'X')
             CONVERT " " TO "_" IN NAME
             CONVERT " " TO "_" IN NAME
             PTIME = OCONV(TIME(),'MT')
             PRI.ID = USER.ID:"~":OID.DATA$<4>:"~":NAME:"-":FIELD(OCONV(DATE(),'D4-'),'-',3):'-':FIELD(OCONV(DATE(),'D2-'),'-',1):'-':FIELD(OCONV(DATE(),'D2-'),'-',2):"-":PTIME ; *Pipeline

             *** Custom coding for CSC797 starts
             CASE PRI.NO = 12;
                GEN = OID.DATA$<2>; IF GEN < 1 THEN GEN = 1
                PRI.ID = OID.DATA$<1>:"~":GEN
             *** Custom coding for CSC797 ends
             CASE PRI.NO = 0;         PRI.ID = ''
             CASE OTHERWISE;          PRI.ID = ACT.ID$
             END CASE

             IF FORM.ID#'' THEN
                IF FORM.ID[1,2] = 'P:' THEN
                   !SUBR = FORM.ID[3,25]
                   !CALL @SUBR(PRI.ID)
                   ERR.MSG = 'PICK Subroutine User Defined Screen is Unsupported at this time'
                END ELSE
                   NULL
                   !FORM.RUN FORM.ID,PRI.ID
                   KEY.ID = PRI.ID
                END
             END
          RETURN
!TSMITH~04/27/14~23:52
