|
of_checkrequired
|
|
Full name
|
pfc_n_ds.of_checkrequired
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_checkrequired(dwbuffer,ref long,ref integer,ref string,boolean)
|
Name
|
Datatype
|
lb_skipmessage
|
boolean
|
ls_msgparm
|
string[2]
|
lw_parent
|
window
|
lw_pfcparent
|
w_master
|
public function integer of_checkrequired (dwbuffer adw_buffer, ref long al_row, ref integer ai_col, ref string as_colname, boolean ab_updateonly);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_CheckRequired
//
// Access: Public
//
// Arguments:
// adw_buffer The buffer to check for required fields
// al_row First row to be checked. Also stores the number of the found row
// ai_col First column to be checked. Also stores the number of the found column
// as_colname Contains the columnname in error
//
// Returns: integer
// 1 = The required fields test was successful, check arguments for required fields missing
// 0 = The required fields test was successful and no errors were found
// -1 = The FindRequired failed
//
// Description:
// Calls the FindRequired function to determine if any of the required
// columns contain null values.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
w_master lw_pfcparent
window lw_parent
boolean lb_skipmessage=False
string ls_msgparm[2]
// Check arguments
if IsNull (adw_buffer) or IsNull (al_row) or IsNull (ai_col) or IsNull (as_colname) then
return -1
end if
SetPointer(HourGlass!)
// Call FindRequired to locate first error, if any
if this.FindRequired (adw_buffer, al_row, ai_col, as_colname, ab_updateonly) < 0 then
return -1
end if
// Check if an error was found.
if al_row <> 0 then
// Get a reference to the window
this.of_GetParentWindow (lw_parent)
if IsValid (lw_parent) then
if lw_parent.TriggerEvent ("pfc_descendant") = 1 then
lw_pfcparent = lw_parent
end if
end if
// Make sure the window is not closing.
if IsValid (lw_pfcparent) then
if lw_pfcparent.of_GetCloseStatus() then
// It is closing, so don't show errors now.
lb_skipmessage = True
end if
end if
If Not lb_skipmessage Then
If IsValid(gnv_app.inv_error) Then
ls_msgparm[1] = as_colname
ls_msgparm[2] = String (al_row)
gnv_app.inv_error.of_Message('pfc_requiredmissingondatastore', ls_msgparm, &
gnv_app.iapp_object.DisplayName)
Else
of_MessageBox ("pfc_checkrequired_missingvalue", gnv_app.iapp_object.DisplayName, &
"Required DataStore value missing for " + as_colname + " on row " + &
String (al_row) + ".", information!, Ok!, 1)
End If
End If
return 1
end if
return 0
end function