1 /*--------------------------------------------------------------------------
3 Purpose
: Assignment routine for all select combo boxes
5 Parameters
: &IntTable - The internal table
6 &IntCode - The internal code for the external table
7 &ExtTable - The external table
8 &ExtKey - The key code of the external table
10 Description
: This will assign the appropriate external table key
11 to the
&IntTable.&IntCode
13 Author
(s
) : Tyrone McAuley
14 Notes
: The private-data of this combo is organised as follows
15 ROWID1
,ROWID2
,.......
,ROWIDn
17 ------------------------------------------------------------------------*/
19 &SCOPED-DEFINE N {&SEQUENCE} /* Helps uniquely identify all variables for
20 multiple references within the same tigger
*/
22 &IF "{&IntTable}" <> "?" &THEN
23 &SCOPED-DEFINE IntTC {&IntTable}.{&IntCode}
25 &SCOPED-DEFINE IntTC {&IntCode}
28 &IF "{&IntTable}" <> "?" &THEN
29 IF AVAILABLE {&IntTable} THEN
32 DO WITH FRAME {&FRAME-NAME}:
34 DEF BUFFER tmp_
{&ExtTable}{&N} FOR {&ExtTable}.
35 DEF VAR item-index
{&N} AS INT NO-UNDO.
36 DEF VAR item-id
{&N} AS CHAR NO-UNDO.
38 item-index
{&N} = {&SELF-NAME}:LOOKUP( {&SELF-NAME}:SCREEN-VALUE ).
39 item-id
{&N} = ENTRY( item-index{&N}, {&SELF-NAME}:PRIVATE-DATA ).
41 FIND FIRST tmp_
{&ExtTable}{&N} WHERE ROWID(tmp_{&ExtTable}{&N}) = TO-ROWID( item-id{&N} )
44 IF AVAILABLE( tmp_
{&ExtTable}{&N} ) THEN DO:
45 &IF "{&IntTable}" <> "?" &THEN
46 FIND CURRENT {&IntTable} EXCLUSIVE-LOCK.
48 ASSIGN {&IntTC} = tmp_{&ExtTable}{&N}.{&ExtKey} NO-ERROR.
49 IF ERROR-STATUS:ERROR THEN DO:
50 MESSAGE ERROR-STATUS:GET-MESSAGE(1).