of_register


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_linkage   >   of_register   

Full name pfc_n_cst_dwsrv_linkage.of_register
Access public
Extend of integer
Return value integer
Prototype public function integer of_register(string,string)

Name Datatype
No Data

Name Datatype
li_newupper Integer
ls_id String

public function integer of_register (string as_masterarg, string as_detailarg);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_Register
//
//	Access:    		Public
//
//	Arguments:
//   as_masterarg:	A string containing the columnname in the master
//                   that is a linkage argument
//   as_detailarg:	A string containing the columnname in the detail
//                   that is a linkage argument matched with the as_masterarg
//
//	Returns:   		Integer
//   					1 if it succeeds and -1 if an error occurs.
//
//	Description:  
//		This function will register the columns between the master and the detail 
//		that link these two datawindows.  These do not necessarily have to 
//		correspond with datawindow retrieval arguments.
//
//		Call this function multiple times for multiple column arguments.
//
//	   *Note: This function should only be called from subordinate datawindows.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.0   Initial version - Replaces obsoleted function of_setArguments(...)
// 7.0	CR186541.  Removed following validation:
//				ls_id = idw_requestor.Describe(as_detailarg+".ID")
//				If Not IsNumber(ls_id) Then Return FAILURE
//			Detail arguments do not have to be a column.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_newupper
String	ls_id

// Verify required reference.
If IsNull(idw_requestor) Or Not IsValid(idw_requestor) Then Return FAILURE

// Trim the arguments.
as_masterarg = Trim(as_masterarg)
as_detailarg = Trim(as_detailarg)

// Verify passed arguments.
If IsNull(as_masterarg) or Len(as_masterarg)=0 Then Return FAILURE
If IsNull(as_detailarg) or Len(as_detailarg)=0 Then Return FAILURE

// Check service.
If IsNull(idw_master) Or Not IsValid(idw_master) Then Return FAILURE
If IsNull(idw_master.inv_Linkage) Or &
	Not IsValid (idw_master.inv_Linkage) Then Return FAILURE

// Check to make sure they are columns.
ls_id = idw_master.Describe(as_masterarg+".ID")
If Not IsNumber(ls_id) Then Return FAILURE

// Establish the boundaries of the array.
li_newupper = UpperBound ( inv_linkargs.is_mastercolarg ) + 1

// Set the columns.
inv_linkargs.is_mastercolarg[li_newupper] = as_masterarg
inv_linkargs.is_detailcolarg[li_newupper] = as_detailarg

// Tell the master that these column links are the master's key columns used 
//	to determine if a refresh of details is necessary.
Return idw_master.inv_Linkage.of_SetKeyCols (as_masterarg)

end function

     
Name Owner
pfc_n_cst_dwsrv_linkage.of_setarguments pfc_n_cst_dwsrv_linkage
u_proftab.dw_master.constructor dw_master
u_persotab.dw_master.constructor dw_master
w_sheet_sales_order.dw_detail.constructor dw_detail

     
Name Owner
datawindow.describe datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isnumber systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_dwsrv_linkage.of_setkeycols pfc_n_cst_dwsrv_linkage

     
Full name
No Data

     
Name Scope
No Data