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 /*------------------------------------------------------------------------
11 ------------------------------------------------------------------------*/
15 /* *************************** Definitions
************************** */
17 DEF VAR mode
AS CHAR NO-UNDO.
18 DEF VAR key-name
AS CHAR NO-UNDO.
19 DEF VAR key-value
AS CHAR NO-UNDO INITIAL ?.
21 DEF VAR frequency-type
AS CHAR NO-UNDO.
22 DEF VAR region-code
AS CHAR NO-UNDO.
24 DEF VAR type-scope
AS CHAR NO-UNDO.
26 /* _UIB-CODE-BLOCK-END
*/
30 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
32 /* ******************** Preprocessor Definitions
******************** */
34 &Scoped-define PROCEDURE-TYPE SmartViewer
36 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
38 /* Name of first Frame and
/or Browse and
/or first Query
*/
39 &Scoped-define FRAME-NAME F-Main
42 &Scoped-define EXTERNAL-TABLES ScenarioAssumption
43 &Scoped-define FIRST-EXTERNAL-TABLE ScenarioAssumption
46 /* Need to scope the external tables to this procedure
*/
47 DEFINE QUERY external_tables
FOR ScenarioAssumption.
48 /* Standard List Definitions
*/
49 &Scoped-Define ENABLED-FIELDS ScenarioAssumption.Scope ~
50 ScenarioAssumption.TypeScope ScenarioAssumption.AssumptionValue
51 &Scoped-define FIELD-PAIRS~
52 ~
{&FP1}AssumptionValue ~{&FP2}AssumptionValue ~{&FP3}
53 &Scoped-define ENABLED-TABLES ScenarioAssumption
54 &Scoped-define FIRST-ENABLED-TABLE ScenarioAssumption
55 &Scoped-Define ENABLED-OBJECTS cmb_Region cmb_Property cmb_Month ~
56 cmb_AssumptionType fil_MonthsVacant fil_PerAnnum fil_PSM cmb_Frequency
57 &Scoped-Define DISPLAYED-FIELDS ScenarioAssumption.ScenarioCode ~
58 ScenarioAssumption.Scope ScenarioAssumption.TypeScope ~
59 ScenarioAssumption.AssumptionValue
60 &Scoped-Define DISPLAYED-OBJECTS cmb_Region cmb_Property cmb_Month ~
61 cmb_AssumptionType fil_MonthsVacant fil_PerAnnum fil_PSM cmb_Frequency
63 /* Custom List Definitions
*/
64 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
66 /* _UIB-PREPROCESSOR-BLOCK-END
*/
70 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" V-table-Win _INLINE
71 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
77 FlowStepType|y|y|TTPL.FlowStepType.FlowStepType
80 **************************
81 * Set attributes related to FOREIGN
KEYS
83 RUN set-attribute-list
(
84 'Keys-Accepted
= "FlowStepType",
85 Keys-Supplied
= "FlowStepType"'
:U
).
86 /**************************
88 /* _UIB-CODE-BLOCK-END
*/
92 /* *********************** Control Definitions
********************** */
95 /* Definitions of the field level widgets
*/
96 DEFINE VARIABLE cmb_AssumptionType
AS CHARACTER FORMAT "X(256)":U
97 LABEL "Assumption type"
98 VIEW-AS COMBO-BOX INNER-LINES 5
100 SIZE 42.86 BY 1.05 NO-UNDO.
102 DEFINE VARIABLE cmb_Frequency
AS CHARACTER FORMAT "X(256)":U
104 VIEW-AS COMBO-BOX INNER-LINES 5
106 SIZE 16 BY 1 NO-UNDO.
108 DEFINE VARIABLE cmb_Month
AS CHARACTER FORMAT "X(256)":U
109 LABEL "Applying from"
110 VIEW-AS COMBO-BOX INNER-LINES 24
112 SIZE 15.43 BY 1 NO-UNDO.
114 DEFINE VARIABLE cmb_Property
AS CHARACTER FORMAT "X(256)":U
116 VIEW-AS COMBO-BOX INNER-LINES 20
118 SIZE 42.86 BY 1 NO-UNDO.
120 DEFINE VARIABLE cmb_Region
AS CHARACTER FORMAT "X(256)":U
122 VIEW-AS COMBO-BOX INNER-LINES 15
124 SIZE 42.86 BY 1 NO-UNDO.
126 DEFINE VARIABLE fil_MonthsVacant
AS INTEGER FORMAT "->,>>>,>>9":U
127 LABEL "Months vacant"
129 SIZE 4.57 BY 1.05 NO-UNDO.
131 DEFINE VARIABLE fil_PerAnnum
AS DECIMAL FORMAT "->>,>>9.99":U
INITIAL 0
134 SIZE 12 BY 1.05 NO-UNDO.
136 DEFINE VARIABLE fil_PSM
AS DECIMAL FORMAT "->>,>>9.99":U
INITIAL 0
139 SIZE 10.14 BY 1.05 NO-UNDO.
142 /* ************************ Frame Definitions
*********************** */
145 ScenarioAssumption.ScenarioCode
AT ROW 2 COL 13.29 COLON-ALIGNED
148 ScenarioAssumption.Scope
AT ROW 3.2 COL 10
149 VIEW-AS COMBO-BOX INNER-LINES 5
150 LIST-ITEMS "G","R","P"
152 cmb_Region
AT ROW 4.4 COL 13.29 COLON-ALIGNED
153 cmb_Property
AT ROW 5.6 COL 13.29 COLON-ALIGNED
154 cmb_Month
AT ROW 7.4 COL 13.29 COLON-ALIGNED
155 ScenarioAssumption.TypeScope
AT ROW 8.4 COL 7
156 LABEL "Applying to" FORMAT "X(20)"
157 VIEW-AS COMBO-BOX INNER-LINES 5
158 LIST-ITEMS "REVU - Rent Review","NLSE - New Lease"
160 cmb_AssumptionType
AT ROW 9.6 COL 13.29 COLON-ALIGNED
161 fil_MonthsVacant
AT ROW 12.4 COL 13.29 COLON-ALIGNED
162 fil_PerAnnum
AT ROW 13.4 COL 13.29 COLON-ALIGNED
163 fil_PSM
AT ROW 13.4 COL 36.14 COLON-ALIGNED
164 cmb_Frequency
AT ROW 13.4 COL 49.86 COLON-ALIGNED
165 ScenarioAssumption.AssumptionValue
AT ROW 15 COL 13.29 COLON-ALIGNED
168 "onwards" VIEW-AS TEXT
169 SIZE 8 BY 1 AT ROW 7.4 COL 30.72
170 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
171 SIDE-LABELS NO-UNDERLINE THREE-D
172 AT COL 1 ROW 1 SCROLLABLE
176 /* *********************** Procedure Settings
************************ */
178 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
179 /* Settings for
THIS-PROCEDURE
181 External Tables
: TTPL.ScenarioAssumption
182 Allow
: Basic
,DB-Fields
184 Add Fields to
: EXTERNAL-TABLES
185 Other Settings
: PERSISTENT-ONLY
COMPILE
188 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
189 /* then cleanup and return.
*/
190 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
191 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
192 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
196 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
198 /* ************************* Create Window
************************** */
200 &ANALYZE-SUSPEND _CREATE-WINDOW
201 /* DESIGN Window definition
(used by the UIB
)
202 CREATE WINDOW V-table-Win
ASSIGN
205 /* END WINDOW DEFINITION
*/
210 /* *************** Runtime Attributes and UIB Settings
************** */
212 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
213 /* SETTINGS
FOR WINDOW V-table-Win
214 VISIBLE,,RUN-PERSISTENT
*/
215 /* SETTINGS
FOR FRAME F-Main
216 NOT-VISIBLE Size-to-Fit
*/
218 FRAME F-Main
:SCROLLABLE = FALSE
219 FRAME F-Main
:HIDDEN = TRUE.
221 /* SETTINGS
FOR FILL-IN ScenarioAssumption.ScenarioCode
IN FRAME F-Main
223 /* SETTINGS
FOR COMBO-BOX ScenarioAssumption.Scope
IN FRAME F-Main
225 /* SETTINGS
FOR COMBO-BOX ScenarioAssumption.TypeScope
IN FRAME F-Main
226 ALIGN-L EXP-LABEL EXP-FORMAT
*/
227 /* _RUN-TIME-ATTRIBUTES-END
*/
231 /* Setting information for Queries and Browse Widgets fields
*/
233 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
234 /* Query rebuild information for
FRAME F-Main
237 */ /* FRAME F-Main
*/
243 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
244 /* ************************* Included-Libraries
*********************** */
246 {src
/adm
/method
/viewer.i
}
247 {inc
/method
/m-mntvwr.i
}
249 /* _UIB-CODE-BLOCK-END
*/
255 /* ************************ Control Triggers
************************ */
257 &Scoped-define SELF-NAME cmb_AssumptionType
258 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AssumptionType V-table-Win
259 ON U1
OF cmb_AssumptionType
IN FRAME F-Main
/* Assumption type
*/
261 {inc
/selcmb
/scrcht1.i
"ScenarioAssumption" "AssumptionType"}
264 /* _UIB-CODE-BLOCK-END
*/
268 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AssumptionType V-table-Win
269 ON U2
OF cmb_AssumptionType
IN FRAME F-Main
/* Assumption type
*/
271 {inc
/selcmb
/scrcht2.i
"ScenarioAssumption" "AssumptionType"}
274 /* _UIB-CODE-BLOCK-END
*/
278 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AssumptionType V-table-Win
279 ON VALUE-CHANGED
OF cmb_AssumptionType
IN FRAME F-Main
/* Assumption type
*/
281 RUN enable-appropriate-fields.
284 /* _UIB-CODE-BLOCK-END
*/
288 &Scoped-define SELF-NAME cmb_Frequency
289 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Frequency V-table-Win
290 ON U1
OF cmb_Frequency
IN FRAME F-Main
/* per
*/
292 {inc
/selcmb
/scfty1.i
"?" "frequency-type"}
295 /* _UIB-CODE-BLOCK-END
*/
299 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Frequency V-table-Win
300 ON U2
OF cmb_Frequency
IN FRAME F-Main
/* per
*/
302 {inc
/selcmb
/scfty2.i
"?" "frequency-type"}
305 /* _UIB-CODE-BLOCK-END
*/
309 &Scoped-define SELF-NAME cmb_Month
310 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Month V-table-Win
311 ON U1
OF cmb_Month
IN FRAME F-Main
/* Applying from
*/
313 {inc
/selcmb
/scmths1.i
"ScenarioAssumption" "MonthCode"}
316 /* _UIB-CODE-BLOCK-END
*/
320 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Month V-table-Win
321 ON U2
OF cmb_Month
IN FRAME F-Main
/* Applying from
*/
323 {inc
/selcmb
/scmths2.i
"ScenarioAssumption" "MonthCode"}
326 /* _UIB-CODE-BLOCK-END
*/
330 &Scoped-define SELF-NAME cmb_Property
331 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Property V-table-Win
332 ON U1
OF cmb_Property
IN FRAME F-Main
/* Property
*/
334 DO WITH FRAME {&FRAME-NAME}:
335 region-code
= ENTRY( 1, cmb_Region
:SCREEN-VALUE, " ").
336 {inc
/selcmb
/scprop1.i
"ScenarioAssumption" "EntityCode" "region-code"}
340 /* _UIB-CODE-BLOCK-END
*/
344 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Property V-table-Win
345 ON U2
OF cmb_Property
IN FRAME F-Main
/* Property
*/
347 {inc
/selcmb
/scprop2.i
"ScenarioAssumption" "EntityCode"}
350 /* _UIB-CODE-BLOCK-END
*/
354 &Scoped-define SELF-NAME cmb_Region
355 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Region V-table-Win
356 ON U1
OF cmb_Region
IN FRAME F-Main
/* Region
*/
358 {inc
/selcmb
/scrgn1.i
"ScenarioAssumption" "Region"}
361 /* _UIB-CODE-BLOCK-END
*/
365 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Region V-table-Win
366 ON U2
OF cmb_Region
IN FRAME F-Main
/* Region
*/
368 {inc
/selcmb
/scrgn2.i
"ScenarioAssumption" "Region"}
371 /* _UIB-CODE-BLOCK-END
*/
375 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Region V-table-Win
376 ON VALUE-CHANGED
OF cmb_Region
IN FRAME F-Main
/* Region
*/
381 /* _UIB-CODE-BLOCK-END
*/
385 &Scoped-define SELF-NAME ScenarioAssumption.Scope
386 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ScenarioAssumption.Scope V-table-Win
387 ON VALUE-CHANGED
OF ScenarioAssumption.Scope
IN FRAME F-Main
/* Scope
*/
389 RUN enable-appropriate-fields.
392 /* _UIB-CODE-BLOCK-END
*/
396 &Scoped-define SELF-NAME ScenarioAssumption.TypeScope
397 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ScenarioAssumption.TypeScope V-table-Win
398 ON VALUE-CHANGED
OF ScenarioAssumption.TypeScope
IN FRAME F-Main
/* Applying to
*/
400 RUN type-scope-changed.
401 RUN enable-appropriate-fields.
404 /* _UIB-CODE-BLOCK-END
*/
410 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
413 /* *************************** Main Block
*************************** */
415 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
416 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
419 /************************ INTERNAL PROCEDURES
********************/
421 /* _UIB-CODE-BLOCK-END
*/
425 /* ********************** Internal Procedures
*********************** */
427 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-find-using-key V-table-Win adm/support/_key-fnd.p
428 PROCEDURE adm-find-using-key
:
429 /*------------------------------------------------------------------------------
430 Purpose
: Finds the current record using the contents of
431 the 'Key-Name' and 'Key-Value' attributes.
433 ------------------------------------------------------------------------------*/
434 DEF VAR key-value
AS CHAR NO-UNDO.
435 DEF VAR row-avail-enabled
AS LOGICAL NO-UNDO.
437 /* LOCK status on the find depends on FIELDS-ENABLED.
*/
438 RUN get-attribute
('FIELDS-ENABLED'
:U
).
439 row-avail-enabled
= (RETURN-VALUE eq 'yes'
:U
).
440 /* Look up the current key-value.
*/
441 RUN get-attribute
('Key-Value'
:U
).
442 key-value
= RETURN-VALUE.
444 /* Find the current record using the current Key-Name.
*/
445 RUN get-attribute
('Key-Name'
:U
).
447 WHEN 'FlowStepType'
:U
THEN
448 {src
/adm
/template
/find-tbl.i
449 &TABLE = FlowStepType
450 &WHERE = "WHERE FlowStepType.FlowStepType eq key-value"
456 /* _UIB-CODE-BLOCK-END
*/
460 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
461 PROCEDURE adm-row-available
:
462 /*------------------------------------------------------------------------------
463 Purpose
: Dispatched to this procedure when the Record-
464 Source has a new row available. This procedure
465 tries to get the new row
(or foriegn keys
) from
466 the Record-Source and process it.
468 ------------------------------------------------------------------------------*/
470 /* Define variables needed by this internal procedure.
*/
471 {src
/adm
/template
/row-head.i
}
473 /* Create a list of all the tables that we need to get.
*/
474 {src
/adm
/template
/row-list.i
"ScenarioAssumption"}
476 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
477 {src
/adm
/template
/row-get.i
}
479 /* FIND each record specified by the RECORD-SOURCE.
*/
480 {src
/adm
/template
/row-find.i
"ScenarioAssumption"}
482 /* Process the newly available records
(i.e. display fields
,
483 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
484 {src
/adm
/template
/row-end.i
}
488 /* _UIB-CODE-BLOCK-END
*/
492 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-changes V-table-Win
493 PROCEDURE cancel-changes
:
494 /*------------------------------------------------------------------------------
495 Purpose
: Quit without applying any changes
496 ------------------------------------------------------------------------------*/
497 IF mode
= "Add" THEN DO TRANSACTION:
498 FIND CURRENT ScenarioAssumption
NO-ERROR.
499 IF AVAILABLE(ScenarioAssumption
) THEN DELETE ScenarioAssumption.
502 RUN check-modified
( 'clear'
:U
).
504 RUN dispatch
( 'exit'
:U
).
508 /* _UIB-CODE-BLOCK-END
*/
512 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE confirm-changes V-table-Win
513 PROCEDURE confirm-changes
:
514 /*------------------------------------------------------------------------------
516 ------------------------------------------------------------------------------*/
518 IF RETURN-VALUE <> "" THEN RETURN.
520 RUN dispatch
( 'update-record'
:U
).
521 RUN notify
( 'open-query
,record-source'
:U
).
523 RUN dispatch
( 'exit'
:U
).
527 /* _UIB-CODE-BLOCK-END
*/
531 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
532 PROCEDURE disable_UI
:
533 /*------------------------------------------------------------------------------
534 Purpose
: DISABLE the User Interface
536 Notes
: Here we clean-up the user-interface by deleting
537 dynamic widgets we have created and
/or hide
538 frames. This procedure is usually called when
539 we are ready to
"clean-up" after running.
540 ------------------------------------------------------------------------------*/
541 /* Hide all frames.
*/
543 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
546 /* _UIB-CODE-BLOCK-END
*/
550 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
551 PROCEDURE enable-appropriate-fields
:
552 /*------------------------------------------------------------------------------
554 ------------------------------------------------------------------------------*/
555 DO WITH FRAME {&FRAME-NAME}:
557 CASE INPUT ScenarioAssumption.Scope
:
559 IF cmb_Region
:SCREEN-VALUE = ?
THEN DO:
560 cmb_Region
:SCREEN-VALUE = cmb_Region
:ENTRY(1).
564 DISABLE cmb_Property.
567 IF cmb_Region
:SCREEN-VALUE = ?
THEN DO:
568 cmb_Region
:SCREEN-VALUE = cmb_Region
:ENTRY(1).
571 IF cmb_Property
:SCREEN-VALUE = ?
THEN cmb_Property
:SCREEN-VALUE = cmb_Property
:ENTRY(1).
572 ENABLE cmb_Region cmb_Property.
575 DISABLE cmb_Region cmb_Property.
579 /* type of assumption
*/
580 DEF VAR assumption-type
AS CHAR NO-UNDO.
581 DEF VAR type-scope
AS CHAR NO-UNDO.
582 type-scope
= ENTRY( 1, INPUT ScenarioAssumption.TypeScope
, " ").
583 assumption-type
= ENTRY( 1, INPUT cmb_AssumptionType
, " ").
584 IF type-scope
= "REVU" OR type-scope
= "NLSE" THEN DO:
585 FIND AreaType
WHERE AreaType.AreaType
= assumption-type
NO-LOCK.
586 IF AreaType.IsCarPark
THEN DO:
587 fil_PSM
:LABEL = "Per park".
588 ENABLE fil_PerAnnum fil_PSM cmb_Frequency.
590 ELSE IF AreaType.IsFloorArea
THEN DO:
596 MESSAGE "Service Contracts not supported yet" SKIP(1)
598 VIEW-AS ALERT-BOX ERROR.
601 /* scope of assumption type
*/
603 CASE INPUT ScenarioAssumption.TypeScope
:
604 WHEN "Rent Review" THEN DO:
606 WHEN "New Leasing" THEN DO:
613 /* _UIB-CODE-BLOCK-END
*/
617 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-assign-statement V-table-Win
618 PROCEDURE inst-assign-statement
:
619 /*------------------------------------------------------------------------------
621 ------------------------------------------------------------------------------*/
622 DO WITH FRAME {&FRAME-NAME}:
623 IF ScenarioAssumption.Scope
= "G" THEN ASSIGN
624 ScenarioAssumption.Region
= ?
625 ScenarioAssumption.EntityType
= ?
626 ScenarioAssumption.EntityCode
= ?.
627 ELSE IF ScenarioAssumption.Scope
= "R" THEN ASSIGN
628 ScenarioAssumption.EntityType
= ?
629 ScenarioAssumption.EntityCode
= ?.
631 DEF VAR type-scope
AS CHAR NO-UNDO.
632 type-scope
= ENTRY( 1, ScenarioAssumption.TypeScope
, " ").
642 /* _UIB-CODE-BLOCK-END
*/
646 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
647 PROCEDURE inst-enable-fields
:
648 /*------------------------------------------------------------------------------
650 ------------------------------------------------------------------------------*/
651 RUN enable-appropriate-fields.
654 /* _UIB-CODE-BLOCK-END
*/
658 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
659 PROCEDURE inst-initialize
:
660 /*------------------------------------------------------------------------------
662 ------------------------------------------------------------------------------*/
664 IF mode
= 'Add'
THEN DO:
666 key-name
= "ScenarioCode":U.
667 key-value
= find-parent-key
( key-name
).
668 CURRENT-WINDOW:TITLE = "Adding a New Scenario Assumption".
669 RUN dispatch
( 'add-record'
:U
).
671 ELSE IF mode
= "Maintain" THEN
672 RUN dispatch
( 'enable-fields'
:U
).
674 RUN dispatch
( 'disable-fields'
:U
).
678 /* _UIB-CODE-BLOCK-END
*/
682 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE override-add-record V-table-Win
683 PROCEDURE override-add-record
:
684 /*------------------------------------------------------------------------------
686 ------------------------------------------------------------------------------*/
687 DO WITH FRAME {&FRAME-NAME}:
689 FIND ScenarioAssumption
WHERE ScenarioAssumption.ScenarioCode
= INT(key-value
)
690 AND ScenarioAssumption.Scope
= ?
NO-LOCK NO-ERROR.
691 IF NOT AVAILABLE(ScenarioAssumption
) THEN CREATE ScenarioAssumption.
693 FIND LAST Month
WHERE Month.StartDate
< TODAY NO-LOCK.
694 FIND FinancialYear
OF Month
NO-LOCK.
695 FIND FIRST Month
OF FinancialYear
NO-LOCK.
697 ASSIGN ScenarioAssumption.ScenarioCode
= INT(key-value
)
698 ScenarioAssumption.Scope
= ?
699 ScenarioAssumption.EntityType
= "P"
700 ScenarioAssumption.Scope
= ScenarioAssumption.Scope
:ENTRY(1)
701 ScenarioAssumption.TypeScope
= ScenarioAssumption.TypeScope
:ENTRY(1)
702 ScenarioAssumption.MonthCode
= Month.MonthCode .
704 CURRENT-WINDOW:TITLE = "Adding a New Scenario Assumption".
705 RUN dispatch
( 'display-fields'
:U
).
706 RUN dispatch
( 'enable-fields'
:U
).
707 RUN dispatch
( 'update-record'
:U
).
713 /* _UIB-CODE-BLOCK-END
*/
717 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
718 PROCEDURE pre-destroy
:
719 /*------------------------------------------------------------------------------
721 ------------------------------------------------------------------------------*/
722 IF LAST-EVENT:FUNCTION = "WINDOW-CLOSE" THEN RUN cancel-changes.
725 /* _UIB-CODE-BLOCK-END
*/
729 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE region-changed V-table-Win
730 PROCEDURE region-changed
:
731 /*------------------------------------------------------------------------------
733 ------------------------------------------------------------------------------*/
734 DO WITH FRAME {&FRAME-NAME}:
735 APPLY "U1":U
TO cmb_Property.
736 DISPLAY cmb_Property.
740 /* _UIB-CODE-BLOCK-END
*/
744 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key V-table-Win adm/support/_key-snd.p
746 /*------------------------------------------------------------------------------
747 Purpose
: Sends a requested
KEY value back to the calling
749 Parameters
: <see adm
/template
/sndkytop.i
>
750 ------------------------------------------------------------------------------*/
752 /* Define variables needed by this internal procedure.
*/
753 {src
/adm
/template
/sndkytop.i
}
755 /* Return the key value associated with each key case.
*/
756 {src
/adm
/template
/sndkycas.i
"FlowStepType" "FlowStepType" "FlowStepType"}
758 /* Close the
CASE statement and end the procedure.
*/
759 {src
/adm
/template
/sndkyend.i
}
763 /* _UIB-CODE-BLOCK-END
*/
767 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
768 PROCEDURE send-records
:
769 /*------------------------------------------------------------------------------
770 Purpose
: Send record
ROWID's for all tables used by
772 Parameters
: see template
/snd-head.i
773 ------------------------------------------------------------------------------*/
775 /* Define variables needed by this internal procedure.
*/
776 {src
/adm
/template
/snd-head.i
}
778 /* For each requested table
, put it's
ROWID in the output list.
*/
779 {src
/adm
/template
/snd-list.i
"ScenarioAssumption"}
781 /* Deal with any unexpected table requests before closing.
*/
782 {src
/adm
/template
/snd-end.i
}
786 /* _UIB-CODE-BLOCK-END
*/
790 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
791 PROCEDURE state-changed
:
792 /* -----------------------------------------------------------
796 -------------------------------------------------------------*/
797 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
798 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
801 /* Object instance CASEs can go here to replace standard behavior
803 {src
/adm
/template
/vstates.i
}
807 /* _UIB-CODE-BLOCK-END
*/
811 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE type-scope-changed V-table-Win
812 PROCEDURE type-scope-changed
:
813 /*------------------------------------------------------------------------------
815 ------------------------------------------------------------------------------*/
816 DEF VAR new-type
AS CHAR NO-UNDO.
818 DO WITH FRAME {&FRAME-NAME}:
819 new-type
= INPUT ScenarioAssumption.TypeScope.
820 IF LOOKUP( type-scope
, "REVU,NLSE") > 0 THEN DO:
821 IF LOOKUP( new-type
, "REVU,NLSE") = 0 THEN APPLY "U1":U
TO cmb_AssumptionType .
823 ELSE IF LOOKUP( new-type
, "REVU,NLSE") > 0 THEN
824 APPLY "U1":U
TO cmb_AssumptionType .
826 type-scope
= new-type.
830 /* _UIB-CODE-BLOCK-END
*/
834 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name V-table-Win
835 PROCEDURE use-Key-Name
:
836 /*------------------------------------------------------------------------------
838 ------------------------------------------------------------------------------*/
839 DEF INPUT PARAMETER new-key-name
AS CHAR NO-UNDO.
840 key-name
= new-key-name.
843 /* _UIB-CODE-BLOCK-END
*/
847 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Value V-table-Win
848 PROCEDURE use-Key-Value
:
849 /*------------------------------------------------------------------------------
851 ------------------------------------------------------------------------------*/
852 DEF INPUT PARAMETER new-key-value
AS CHAR NO-UNDO.
853 key-value
= new-key-value.
856 /* _UIB-CODE-BLOCK-END
*/
860 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Mode V-table-Win
862 /*------------------------------------------------------------------------------
864 ------------------------------------------------------------------------------*/
865 DEF INPUT PARAMETER new-mode
AS CHAR NO-UNDO.
869 /* _UIB-CODE-BLOCK-END
*/
873 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-record V-table-Win
874 PROCEDURE verify-record
:
875 /*------------------------------------------------------------------------------
877 ------------------------------------------------------------------------------*/
878 DEF VAR input-task-type
AS CHAR NO-UNDO.
880 DO WITH FRAME {&FRAME-NAME}:
886 /* _UIB-CODE-BLOCK-END
*/