|
pfc_predeleterow
|
|
Full name
|
pfc_n_cst_dwsrv_linkage.pfc_predeleterow
|
Access
|
public
|
Extend of
|
long
|
Return value
|
long
|
Prototype
|
event long pfc_predeleterow(long)
|
Name
|
Datatype
|
li_i
|
integer
|
li_option
|
integer
|
li_upperbound
|
integer
|
ls_msgparm
|
string[]
|
ls_reset
|
string[]
|
event pfc_predeleterow;call super::pfc_predeleterow;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_predeleterow
//
// Arguments:
// al_row: A long identifying the row which may be being deleted.
// If no row is passed in, use the current row.
//
// Returns: Integer
// 1 if it succeeds and the deleterow should continue.
// 0 if the delete should be prevented.
// -1 If an error is encountered.
//
// Description:
// Notification that the row may be deleted. Depending on the attributes,
// a cancel of the delete operation is possible through the dialog window.
//
// 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_i
integer li_upperbound
string ls_reset[]
string ls_msgparm[]
integer li_option
// Validate required references.
If IsNull(idw_requestor) Or Not IsValid(idw_requestor) Then
Return FAILURE
End If
// If no row is passed in, use the current row.
if IsNull(al_row) or al_row = 0 then
al_row = idw_requestor.GetRow()
end if
// Reset the key value information.
is_keycolsvalue = ls_reset
// Determine by looking at the linked dws, if current dw requires
// Updates to occur on RowChange. Do not perform the check if this
// is a cascading delete.
If Not ib_cascadingdelete And of_UpdateOnRowChange() Then
If of_ConfirmOnDelete() Then
If IsValid(gnv_app.inv_error) Then
li_option = gnv_app.inv_error.of_Message('pfc_dwlinkage_predelete', ls_msgparm, &
gnv_app.iapp_object.DisplayName)
Else
li_option = of_MessageBox('pfc_linkage_deleterow', &
gnv_app.iapp_object.DisplayName, &
'Delete row(s)?', Exclamation!, OkCancel!, 1)
End If
If li_option <> 1 Then
// Prevent the delete from taking place.
Return PREVENT_ACTION
End If
End If
End If
// Store key value information about the row which is being considered
// for deletion.
li_upperbound = UpperBound(is_keycols)
for li_i = 1 to li_upperbound
is_keycolsvalue[li_i] = of_BuildComparison (al_row, is_keycols[li_i] )
Next
If al_row = idw_requestor.RowCount() Then
// Set the prevent focus change functionality.
// This will delay the rowfocuschanged until all desired action can be
// completed.
ib_preventfocuschanged = True
End If
// Allow delete to take place.
Return CONTINUE_ACTION
end event