1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
9 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 DEF VAR mode
AS CHAR NO-UNDO.
16 DEF VAR key-name
AS CHAR NO-UNDO.
17 DEF VAR key-value
AS CHAR NO-UNDO.
19 DEF VAR project-code
AS INT NO-UNDO.
20 DEF VAR variation-code
AS INT NO-UNDO.
21 DEF VAR account-code
AS DEC NO-UNDO.
22 DEF VAR month-code
AS INT NO-UNDO.
25 FIND FIRST VariationFlow
NO-LOCK NO-ERROR.
27 /* _UIB-CODE-BLOCK-END
*/
31 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
33 /* ******************** Preprocessor Definitions
******************** */
35 &Scoped-define PROCEDURE-TYPE SmartViewer
37 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
39 /* Name of first Frame and
/or Browse and
/or first Query
*/
40 &Scoped-define FRAME-NAME F-Main
43 &Scoped-define EXTERNAL-TABLES Variation Project VariationFlow
44 &Scoped-define FIRST-EXTERNAL-TABLE Variation
47 /* Need to scope the external tables to this procedure
*/
48 DEFINE QUERY external_tables
FOR Variation
, Project
, VariationFlow.
49 /* Standard List Definitions
*/
50 &Scoped-Define ENABLED-FIELDS VariationFlow.Amount
51 &Scoped-define FIELD-PAIRS~
52 ~
{&FP1}Amount ~{&FP2}Amount ~{&FP3}
53 &Scoped-define ENABLED-TABLES VariationFlow
54 &Scoped-define FIRST-ENABLED-TABLE VariationFlow
55 &Scoped-Define ENABLED-OBJECTS RECT-1 cmb_Account cmb_Month
56 &Scoped-Define DISPLAYED-FIELDS VariationFlow.ProjectCode Project.Name ~
57 VariationFlow.VariationCode Variation.Reason VariationFlow.Amount
58 &Scoped-Define DISPLAYED-OBJECTS cmb_Account cmb_Month
60 /* Custom List Definitions
*/
61 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
63 /* _UIB-PREPROCESSOR-BLOCK-END
*/
67 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" V-table-Win _INLINE
68 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
74 ProjectCode|y|y|ttpl.VariationFlow.ProjectCode
75 VariationCode|y|y|ttpl.VariationFlow.VariationCode
76 MonthCode||y|ttpl.VariationFlow.MonthCode
79 **************************
80 * Set attributes related to FOREIGN
KEYS
82 RUN set-attribute-list
(
83 'Keys-Accepted
= "ProjectCode,VariationCode",
84 Keys-Supplied
= "ProjectCode,VariationCode,MonthCode"'
:U
).
85 /**************************
87 /* _UIB-CODE-BLOCK-END
*/
91 /* *********************** Control Definitions
********************** */
94 /* Definitions of the field level widgets
*/
95 DEFINE VARIABLE cmb_Account
AS CHARACTER FORMAT "X(256)":U
97 VIEW-AS COMBO-BOX INNER-LINES 15
101 DEFINE VARIABLE cmb_Month
AS CHARACTER FORMAT "X(256)":U
103 VIEW-AS COMBO-BOX INNER-LINES 20
105 SIZE 26.86 BY 1 NO-UNDO.
107 DEFINE RECTANGLE RECT-1
108 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
112 /* ************************ Frame Definitions
*********************** */
115 VariationFlow.ProjectCode
AT ROW 1.2 COL 7 COLON-ALIGNED
119 Project.Name
AT ROW 1.2 COL 17.29 COLON-ALIGNED NO-LABEL
122 VariationFlow.VariationCode
AT ROW 2.2 COL 7 COLON-ALIGNED
126 Variation.Reason
AT ROW 2.2 COL 17.29 COLON-ALIGNED NO-LABEL
129 cmb_Account
AT ROW 4.2 COL 7 COLON-ALIGNED
130 cmb_Month
AT ROW 5.4 COL 7 COLON-ALIGNED
131 VariationFlow.Amount
AT ROW 5.4 COL 51 COLON-ALIGNED
134 RECT-1
AT ROW 1 COL 1
135 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
136 SIDE-LABELS NO-UNDERLINE THREE-D
137 AT COL 1 ROW 1 SCROLLABLE
141 /* *********************** Procedure Settings
************************ */
143 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
144 /* Settings for
THIS-PROCEDURE
146 External Tables
: ttpl.Variation
,ttpl.Project
,ttpl.VariationFlow
147 Allow
: Basic
,DB-Fields
149 Add Fields to
: EXTERNAL-TABLES
150 Other Settings
: PERSISTENT-ONLY
COMPILE
153 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
154 /* then cleanup and return.
*/
155 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
156 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
157 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
161 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
163 /* ************************* Create Window
************************** */
165 &ANALYZE-SUSPEND _CREATE-WINDOW
166 /* DESIGN Window definition
(used by the UIB
)
167 CREATE WINDOW V-table-Win
ASSIGN
170 /* END WINDOW DEFINITION
*/
175 /* *************** Runtime Attributes and UIB Settings
************** */
177 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
178 /* SETTINGS
FOR WINDOW V-table-Win
179 VISIBLE,,RUN-PERSISTENT
*/
180 /* SETTINGS
FOR FRAME F-Main
181 NOT-VISIBLE Size-to-Fit
*/
183 FRAME F-Main
:SCROLLABLE = FALSE
184 FRAME F-Main
:HIDDEN = TRUE.
186 /* SETTINGS
FOR FILL-IN Project.Name
IN FRAME F-Main
187 NO-ENABLE EXP-LABEL
*/
188 /* SETTINGS
FOR FILL-IN VariationFlow.ProjectCode
IN FRAME F-Main
189 NO-ENABLE EXP-LABEL
*/
190 /* SETTINGS
FOR FILL-IN Variation.Reason
IN FRAME F-Main
191 NO-ENABLE EXP-LABEL
*/
192 /* SETTINGS
FOR FILL-IN VariationFlow.VariationCode
IN FRAME F-Main
193 NO-ENABLE EXP-LABEL
*/
194 /* _RUN-TIME-ATTRIBUTES-END
*/
198 /* Setting information for Queries and Browse Widgets fields
*/
200 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
201 /* Query rebuild information for
FRAME F-Main
204 */ /* FRAME F-Main
*/
210 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
211 /* ************************* Included-Libraries
*********************** */
213 {src
/adm
/method
/viewer.i
}
214 {inc
/method
/m-mntvwr.i
}
216 /* _UIB-CODE-BLOCK-END
*/
222 /* ************************ Control Triggers
************************ */
224 &Scoped-define SELF-NAME cmb_Account
225 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Account V-table-Win
226 ON U1
OF cmb_Account
IN FRAME F-Main
/* Account
*/
228 {inc
/selcmb
/scpbdg1.i
"VariationFlow" "AccountCode" "INPUT VariationFlow.ProjectCode"}
231 /* _UIB-CODE-BLOCK-END
*/
235 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Account V-table-Win
236 ON U2
OF cmb_Account
IN FRAME F-Main
/* Account
*/
238 {inc
/selcmb
/scpbdg2.i
"VariationFlow" "AccountCode" "INPUT VariationFlow.ProjectCode"}
241 /* _UIB-CODE-BLOCK-END
*/
245 &Scoped-define SELF-NAME cmb_Month
246 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Month V-table-Win
247 ON U1
OF cmb_Month
IN FRAME F-Main
/* Month
*/
249 {inc
/selcmb
/scmths1.i
"VariationFlow" "MonthCode"}
251 /* plus we try and find a near-current month when adding
*/
252 IF mode
= "Add" AND month-code
<> 0 THEN DO WITH FRAME {&FRAME-NAME}:
253 FIND Month
WHERE Month.MonthCode
= month-code
NO-LOCK NO-ERROR.
254 IF AVAILABLE(Month
) THEN
255 {&SELF-NAME}:SCREEN-VALUE = STRING( Month.StartDate, "99/99/9999").
259 /* _UIB-CODE-BLOCK-END
*/
263 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Month V-table-Win
264 ON U2
OF cmb_Month
IN FRAME F-Main
/* Month
*/
266 {inc
/selcmb
/scmths2.i
"VariationFlow" "MonthCode"}
269 /* _UIB-CODE-BLOCK-END
*/
275 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
278 /* *************************** Main Block
*************************** */
280 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
281 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
284 /************************ INTERNAL PROCEDURES
********************/
286 /* _UIB-CODE-BLOCK-END
*/
290 /* ********************** Internal Procedures
*********************** */
292 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-find-using-key V-table-Win adm/support/_key-fnd.p
293 PROCEDURE adm-find-using-key
:
294 /*------------------------------------------------------------------------------
295 Purpose
: Finds the current record using the contents of
296 the 'Key-Name' and 'Key-Value' attributes.
298 ------------------------------------------------------------------------------*/
299 DEF VAR key-value
AS CHAR NO-UNDO.
300 DEF VAR row-avail-enabled
AS LOGICAL NO-UNDO.
302 /* LOCK status on the find depends on FIELDS-ENABLED.
*/
303 RUN get-attribute
('FIELDS-ENABLED'
:U
).
304 row-avail-enabled
= (RETURN-VALUE eq 'yes'
:U
).
305 /* Look up the current key-value.
*/
306 RUN get-attribute
('Key-Value'
:U
).
307 key-value
= RETURN-VALUE.
309 /* Find the current record using the current Key-Name.
*/
310 RUN get-attribute
('Key-Name'
:U
).
312 WHEN 'ProjectCode'
:U
THEN
313 {src
/adm
/template
/find-tbl.i
314 &TABLE = VariationFlow
315 &WHERE = "WHERE VariationFlow.ProjectCode eq INTEGER(key-value)"
317 WHEN 'VariationCode'
:U
THEN
318 {src
/adm
/template
/find-tbl.i
319 &TABLE = VariationFlow
320 &WHERE = "WHERE VariationFlow.VariationCode eq INTEGER(key-value)"
326 /* _UIB-CODE-BLOCK-END
*/
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
331 PROCEDURE adm-row-available
:
332 /*------------------------------------------------------------------------------
333 Purpose
: Dispatched to this procedure when the Record-
334 Source has a new row available. This procedure
335 tries to get the new row
(or foriegn keys
) from
336 the Record-Source and process it.
338 ------------------------------------------------------------------------------*/
340 /* Define variables needed by this internal procedure.
*/
341 {src
/adm
/template
/row-head.i
}
343 /* Create a list of all the tables that we need to get.
*/
344 {src
/adm
/template
/row-list.i
"Variation"}
345 {src
/adm
/template
/row-list.i
"Project"}
346 {src
/adm
/template
/row-list.i
"VariationFlow"}
348 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
349 {src
/adm
/template
/row-get.i
}
351 /* FIND each record specified by the RECORD-SOURCE.
*/
352 {src
/adm
/template
/row-find.i
"Variation"}
353 {src
/adm
/template
/row-find.i
"Project"}
354 {src
/adm
/template
/row-find.i
"VariationFlow"}
356 /* Process the newly available records
(i.e. display fields
,
357 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
358 {src
/adm
/template
/row-end.i
}
362 /* _UIB-CODE-BLOCK-END
*/
366 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-changes V-table-Win
367 PROCEDURE cancel-changes
:
368 /*------------------------------------------------------------------------------
370 ------------------------------------------------------------------------------*/
371 IF mode
= "Add" THEN RUN delete-flow.
372 RUN dispatch
( 'exit'
:U
).
375 /* _UIB-CODE-BLOCK-END
*/
379 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE confirm-changes V-table-Win
380 PROCEDURE confirm-changes
:
381 /*------------------------------------------------------------------------------
383 ------------------------------------------------------------------------------*/
385 IF RETURN-VALUE = "FAIL" THEN RETURN.
387 RUN dispatch
( 'update-record'
:U
).
388 IF mode
= "Add" THEN RUN notify
( 'open-query
,record-source'
:U
).
389 RUN dispatch
( 'exit'
:U
).
393 /* _UIB-CODE-BLOCK-END
*/
397 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE delete-flow V-table-Win
398 PROCEDURE delete-flow
:
399 /*------------------------------------------------------------------------------
401 ------------------------------------------------------------------------------*/
402 IF NOT AVAILABLE(VariationFlow
) THEN RETURN.
403 FIND CURRENT VariationFlow
EXCLUSIVE-LOCK NO-ERROR.
404 IF NOT AVAILABLE(VariationFlow
) THEN RETURN.
405 DELETE VariationFlow
NO-ERROR.
408 /* _UIB-CODE-BLOCK-END
*/
412 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
413 PROCEDURE disable_UI
:
414 /*------------------------------------------------------------------------------
415 Purpose
: DISABLE the User Interface
417 Notes
: Here we clean-up the user-interface by deleting
418 dynamic widgets we have created and
/or hide
419 frames. This procedure is usually called when
420 we are ready to
"clean-up" after running.
421 ------------------------------------------------------------------------------*/
422 /* Hide all frames.
*/
424 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
427 /* _UIB-CODE-BLOCK-END
*/
431 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
432 PROCEDURE inst-enable-fields
:
433 /*------------------------------------------------------------------------------
435 ------------------------------------------------------------------------------*/
436 DO WITH FRAME {&FRAME-NAME}:
437 IF mode
= "Add" THEN DO:
438 ENABLE cmb_Account cmb_Month.
441 DISABLE cmb_Account cmb_Month.
446 /* _UIB-CODE-BLOCK-END
*/
450 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
451 PROCEDURE inst-initialize
:
452 /*------------------------------------------------------------------------------
454 ------------------------------------------------------------------------------*/
455 IF mode
= "Add" THEN RUN dispatch
( 'add-record'
:U
).
457 RUN dispatch
( 'enable-fields'
:U
).
461 /* _UIB-CODE-BLOCK-END
*/
465 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE normal-send-key V-table-Win adm/support/_key-snd.p
466 PROCEDURE normal-send-key
:
467 /*------------------------------------------------------------------------------
468 Purpose
: Sends a requested
KEY value back to the calling
470 Parameters
: <see adm
/template
/sndkytop.i
>
471 ------------------------------------------------------------------------------*/
473 /* Define variables needed by this internal procedure.
*/
474 {src
/adm
/template
/sndkytop.i
}
476 /* Return the key value associated with each key case.
*/
477 {src
/adm
/template
/sndkycas.i
"ProjectCode" "VariationFlow" "ProjectCode"}
478 {src
/adm
/template
/sndkycas.i
"VariationCode" "VariationFlow" "VariationCode"}
479 {src
/adm
/template
/sndkycas.i
"MonthCode" "VariationFlow" "MonthCode"}
481 /* Close the
CASE statement and end the procedure.
*/
482 {src
/adm
/template
/sndkyend.i
}
486 /* _UIB-CODE-BLOCK-END
*/
490 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE override-add-record V-table-Win
491 PROCEDURE override-add-record
:
492 /*------------------------------------------------------------------------------
494 ------------------------------------------------------------------------------*/
495 DEF VAR rs-hdl
AS HANDLE NO-UNDO.
496 DEF VAR new-key
AS CHAR NO-UNDO.
498 RUN get-link-handle
IN adm-broker-hdl
( THIS-PROCEDURE, 'RECORD-SOURCE'
:U
, OUTPUT new-key
).
499 rs-hdl
= WIDGET-HANDLE(new-key
).
500 IF VALID-HANDLE( rs-hdl
) THEN DO:
501 RUN send-key
IN rs-hdl
( "VariationFlow", OUTPUT new-key
).
502 IF new-key
<> ?
AND TRIM(new-key
) <> "" THEN DO:
503 RUN set-attribute-list
( 'Key-Name
= VariationFlow
, Key-Value
= '
:U
+ new-key
).
505 IF project-code
= 0 OR variation-code
= 0 THEN DO:
506 RUN send-key
IN rs-hdl
( "ProjectCode", OUTPUT new-key
).
507 project-code
= INT(new-key
).
508 FIND Project
WHERE Project.ProjectCode
= project-code
NO-LOCK NO-ERROR.
509 RUN send-key
IN rs-hdl
( "VariationCode", OUTPUT new-key
).
510 variation-code
= INT(new-key
).
516 FIND FIRST VariationFlow
EXCLUSIVE-LOCK WHERE VariationFlow.ProjectCode
= project-code
517 AND VariationFlow.VariationCode
= variation-code
518 AND VariationFlow.AccountCode
= 0
519 AND VariationFlow.MonthCode
= 0 NO-ERROR.
520 IF NOT AVAILABLE(VariationFlow
) THEN CREATE VariationFlow.
522 ASSIGN VariationFlow.ProjectCode
= project-code
523 VariationFlow.VariationCode
= variation-code
524 VariationFlow.AccountCode
= account-code
525 VariationFlow.MonthCode
= 0
526 VariationFlow.Amount
= 0.
528 FIND CURRENT VariationFlow
NO-LOCK.
530 FIND Variation
OF VariationFlow
NO-LOCK.
531 DEF BUFFER VFL
FOR VariationFlow.
532 FOR EACH VFL
OF Variation
WHERE RECID(VFL
) <> RECID(VariationFlow
) EXCLUSIVE-LOCK:
533 IF VFL.MonthCode
= 0 OR VFL.AccountCode
= 0 THEN DELETE VFL.
535 RUN dispatch
IN THIS-PROCEDURE ('display-fields'
:U
).
540 /* _UIB-CODE-BLOCK-END
*/
544 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
545 PROCEDURE pre-destroy
:
546 /*------------------------------------------------------------------------------
548 ------------------------------------------------------------------------------*/
549 RUN check-modified
( 'clear'
:U
).
552 /* _UIB-CODE-BLOCK-END
*/
556 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key V-table-Win
558 /*------------------------------------------------------------------------------
562 ------------------------------------------------------------------------------*/
566 /* _UIB-CODE-BLOCK-END
*/
570 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
571 PROCEDURE send-records
:
572 /*------------------------------------------------------------------------------
573 Purpose
: Send record
ROWID's for all tables used by
575 Parameters
: see template
/snd-head.i
576 ------------------------------------------------------------------------------*/
578 /* Define variables needed by this internal procedure.
*/
579 {src
/adm
/template
/snd-head.i
}
581 /* For each requested table
, put it's
ROWID in the output list.
*/
582 {src
/adm
/template
/snd-list.i
"Variation"}
583 {src
/adm
/template
/snd-list.i
"Project"}
584 {src
/adm
/template
/snd-list.i
"VariationFlow"}
586 /* Deal with any unexpected table requests before closing.
*/
587 {src
/adm
/template
/snd-end.i
}
591 /* _UIB-CODE-BLOCK-END
*/
595 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
596 PROCEDURE state-changed
:
597 /* -----------------------------------------------------------
601 -------------------------------------------------------------*/
602 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
603 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
606 /* Object instance CASEs can go here to replace standard behavior
608 {src
/adm
/template
/vstates.i
}
612 /* _UIB-CODE-BLOCK-END
*/
616 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name V-table-Win
617 PROCEDURE use-Key-Name
:
618 /*------------------------------------------------------------------------------
620 ------------------------------------------------------------------------------*/
621 DEF INPUT PARAMETER new-name
AS CHAR NO-UNDO.
625 /* _UIB-CODE-BLOCK-END
*/
629 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Value V-table-Win
630 PROCEDURE use-Key-Value
:
631 /*------------------------------------------------------------------------------
633 ------------------------------------------------------------------------------*/
634 DEF INPUT PARAMETER new-key
AS CHAR NO-UNDO.
636 IF key-name
= "VariationFlow" AND TRIM(new-key
) <> "" THEN DO:
637 project-code
= INT( ENTRY( 1, new-key
, "/" ) ).
638 variation-code
= INT( ENTRY( 2, new-key
, "/" ) ).
639 account-code
= DEC( ENTRY( 3, new-key
, "/" ) ).
640 month-code
= INT( ENTRY( 4, new-key
, "/" ) ).
641 FIND VariationFlow
NO-LOCK WHERE VariationFlow.ProjectCode
= project-code
642 AND VariationFlow.VariationCode
= variation-code
643 AND VariationFlow.AccountCode
= account-code
644 AND VariationFlow.MonthCode
= month-code
NO-ERROR.
646 ELSE IF key-name
= "Variation" AND TRIM(new-key
) <> "" THEN DO:
647 project-code
= INT( ENTRY( 1, new-key
) ).
648 variation-code
= INT( ENTRY( 2, new-key
) ).
650 FIND Variation
NO-LOCK WHERE Variation.ProjectCode
= project-code
651 AND Variation.VariationCode
= variation-code
NO-ERROR.
652 IF AVAILABLE(Variation
) THEN
653 FIND Project
OF Variation
NO-LOCK NO-ERROR.
657 /* _UIB-CODE-BLOCK-END
*/
661 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Mode V-table-Win
663 /*------------------------------------------------------------------------------
665 ------------------------------------------------------------------------------*/
666 DEF INPUT PARAMETER new-mode
AS CHAR NO-UNDO.
670 /* _UIB-CODE-BLOCK-END
*/
674 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-flow V-table-Win
675 PROCEDURE verify-flow
:
676 /*------------------------------------------------------------------------------
678 ------------------------------------------------------------------------------*/
679 DEF BUFFER VFL
FOR VariationFlow.
681 DEF VAR in-month
AS INT NO-UNDO.
682 DEF VAR in-account
AS DEC NO-UNDO.
684 DO WITH FRAME {&FRAME-NAME}:
685 FIND Month
WHERE Month.StartDate
= DATE( cmb_Month
:SCREEN-VALUE ) NO-LOCK NO-ERROR.
686 IF NOT AVAILABLE(Month
) THEN RETURN "FAIL".
687 in-month
= Month.MonthCode.
689 in-account
= DEC( ENTRY( 1, cmb_Account
:SCREEN-VALUE, " ") ).
690 FIND VFL
NO-LOCK WHERE VFL.ProjectCode
= VariationFlow.ProjectCode
691 AND VFL.VariationCode
= VariationFlow.VariationCode
692 AND VFL.AccountCode
= in-account
693 AND VFL.MonthCode
= in-month
695 IF mode
= "Add" AND AVAILABLE(VFL
) THEN DO:
696 MESSAGE "Flow already exists for account " + STRING( in-account
, "9999.99") "for that month."
697 VIEW-AS ALERT-BOX ERROR TITLE "Flow already exists - use Maintain".
704 /* _UIB-CODE-BLOCK-END
*/