of_checkrequired


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_linkage   >   of_checkrequired   

Full name pfc_n_cst_dwsrv_linkage.of_checkrequired
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_checkrequired(dwbuffer,ref long,ref integer,ref string,boolean)

Name Datatype
No Data

Name Datatype
ll_originalrow long
ls_msgparm string[2]

protected 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:  Protected
//
//	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 missing data was 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.
//
//////////////////////////////////////////////////////////////////////////////

long		ll_originalrow
string	ls_msgparm[2]

// Check required reference.
If IsNull(idw_requestor) or Not IsValid(idw_requestor) Then
	Return FAILURE
End If

// Check arguments
if IsNull (adw_buffer) or IsNull (al_row) or IsNull (ai_col) or IsNull (as_colname) then
	return FAILURE
end if

SetPointer(HourGlass!) 
ll_originalrow = al_row

// Call FindRequired to locate first missing, if any
if idw_requestor.FindRequired (adw_buffer, al_row, ai_col, as_colname, ab_updateonly) < 0 then
	return FAILURE
end if

// Check if an missing was found.
if al_row <> 0 then
	
	If al_row = ll_originalrow 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_dwlinkage_requiredmissing', ls_msgparm, &
					gnv_app.iapp_object.DisplayName)
		Else
			of_MessageBox ('pfc_linkage_checkrequiredmissing', gnv_app.iapp_object.DisplayName, &
				"Required value missing for " + &
				as_colname + " on row "  + String (al_row) + &
				".  Please enter a value.", information!, Ok!, 1)
		End If
		idw_requestor.SetColumn (ai_col)
		idw_requestor.SetFocus () 		
	Else
		Return FAILURE
	End If
	//	 1 = Check arguments for required fields missing
	return 1
end if

//	 0 = No missing data was found
return 0
end function

     
Name Owner
pfc_n_cst_dwsrv_linkage.of_save pfc_n_cst_dwsrv_linkage

     
Name Owner
dragobject.setfocus dragobject
datawindow.findrequired datawindow
datawindow.setcolumn datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.setpointer systemfunctions
systemfunctions.string systemfunctions
pfc_n_cst_error.of_message pfc_n_cst_error
pfc_n_base.of_messagebox pfc_n_base

     
Full name
demopfc

     
Name Scope
No Data