/*---------------------------------------------------------------------
Purpose: Assigns form field data value to frame screen value. Parameters: p-field-value Notes: This input trigger of the hidden field cusrowid sets the current row to the one in the hidden field to set the context in preparation for further processing. ---------------------------------------------------------------------*/ DEFINE INPUT PARAMETER p-field-value AS CHARACTER NO-UNDO. DO WITH FRAME {&FRAME-NAME}: setCurrentRowids (p-field-value). END. END PROCEDURE. |
/*---------------------------------------------------------------------
Purpose: Super Override Parameters: Notes: After standard behavior for this procedure, this procedure override looks at a hidden field called AddMode, and sets a flag indicating that this record is new, and must be created in the database before the fields are assigned. The AddMode flag is then turned off in preparation for sending the next page. ---------------------------------------------------------------------*/ RUN SUPER. IF ab_unmap.AddMode:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "YES" THEN DO: PleaseAdd = TRUE. setAddMode (TRUE). END. IF ab_unmap.AddMode:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "NO" THEN DO: PleaseAdd = FALSE. setAddMode (FALSE). END. ab_unmap.AddMode:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "NO". END PROCEDURE. |
/*---------------------------------------------------------------------
Purpose: Super Override Parameters: Notes: This outputs the current record to the hidden field cusrowid before standard behavior for this procedure and outputs the AddMode hidden field. ---------------------------------------------------------------------*/ IF getUpdateMode() = "Add" THEN ab_unmap.AddMode:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "YES". ELSE ab_unmap.AddMode:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "NO". ab_unmap.cusrowid:SCREEN-VALUE IN FRAME {&FRAME-NAME} = getRowids(). RUN SUPER. END PROCEDURE. |
IF REQUEST_METHOD = "POST":U THEN DO:
RUN inputFields. UN findRecords. CASE get-field ("requestedAction"): WHEN "First" THEN RUN fetchFirst. WHEN "Next" THEN RUN fetchNext. WHEN "Prev" THEN RUN fetchPrev. WHEN "Last" THEN RUN fetchLast. WHEN "Search for Name" THEN DO: addSearchCriteria('name',get-value('searchname')). RUN findRecords. END. /* Maintenance action selected */ WHEN "Save" THEN DO: IF getUpdateMode () NE "add" THEN RUN fetchCurrent. RUN assignFields. setAddMode (FALSE). setUpdateMode (""). END. WHEN "Delete" THEN DO: RUN fetchCurrent. deleteRow(). END. WHEN "Reset" THEN RUN fetchCurrent. WHEN "Cancel" THEN DO: RUN fetchCurrent. setUpdateMode (""). END. WHEN "Add" THEN DO: RUN fetchCurrent. setUpdateMode ("Add"). END. END CASE. |