|
pfc_preinsertrow
|
|
Full name
|
pfc_n_cst_dwsrv_linkage.pfc_preinsertrow
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
event integer pfc_preinsertrow()
|
Name
|
Datatype
|
li_fnrc
|
Integer
|
li_rc
|
Integer
|
event pfc_preinsertrow;call super::pfc_preinsertrow;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_preinsertrow
//
// Arguments: None
//
// Returns: integer
// 1 if it succeeds and the insertrow should continue.
// 0 if the insertrow should be prevented.
// -1 if an error occurs
//
// Description:
// Notification that a row is about to be inserted.
// Determine if the Row that is about to be added should be stopped or cancelled.
// When desired, perform an update of the current data prior to allowing a new row.
//
// Note:
// This is a Continue or Prevent event.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
Integer li_rc = 1
Integer li_fnrc
// Validate the required reference.
If IsNull(idw_requestor) or Not IsValid(idw_requestor) Then
Return FAILURE
End If
// Determine by looking at the linked dws, if current dw requires
// Updates to occur on RowChange.
If of_UpdateOnRowChange() Then
// If appropriate Save the data. (if applicable, perform prompt.)
li_rc = of_Save(idw_requestor.GetRow(), True)
If li_rc = 2 Then
// -- The user wants to loose all pending updates starting with this
// datawindow and down the chain. --
// Loose all pending changes from this datawindow.
li_fnrc = of_UndoModified()
ElseIf li_rc <= -1 or li_rc >= 3 Then
Return PREVENT_ACTION
End If
End If
Return CONTINUE_ACTION
end event