of_setkeyvalues


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_linkage   >   of_setkeyvalues   

Full name pfc_n_cst_dwsrv_linkage.of_setkeyvalues
Access public
Extend of integer
Return value integer
Prototype public function integer of_setkeyvalues(long)

Name Datatype
No Data

Name Datatype
le_rowstatus dwItemStatus
li_i Integer
li_numlinks Integer
ll_currrow Long
ls_coldata String

public function integer of_setkeyvalues (long al_row);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_SetKeyValues
//
//	Access:    		Public
//
//	Arguments: 		
//	 al_row			Row number.
//
//	Returns:   		Integer
//   					1 if it succeeds and -1 if an error occurs.
//
//	Description:  	
//		Gets key column values from the master and sets the value in row.
//
//	   *Note:	This function is not typically called by the developer.  
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
// 5.0.02 Replaced of_GetItem(...) call with of_GetItemAny(...) to get the column
//			data from the master.
// 6.0	Enhanced to use the Status On InsertRow functionality.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_numlinks
String	ls_coldata
Long		ll_currrow
dwItemStatus le_rowstatus

// This operation is not valid for the root datawindow.
If Of_IsRoot() Then Return -1

// Verify that master has started the linkage service.
If IsNull(idw_master.inv_linkage) Or &
	Not IsValid(idw_master.inv_linkage) Then Return -1

// Validate the current row of the master datawindow.
ll_currrow = idw_master.GetRow()
If ll_currrow <= 0 Then Return -1

// Loop thru all the link columns.
li_numlinks = UpperBound ( inv_linkargs.is_mastercolarg ) 
For li_i = 1 to li_numlinks

	// Get the column data value from the master.
	ls_coldata =  string( idw_master.inv_Linkage.of_GetItemAny (ll_currrow, &
									inv_linkargs.is_mastercolarg[li_i] ) )
	
	If IsNull(ls_coldata) or Len(Trim(ls_coldata))=0 Then 
		// Skip to the next loop.
		Continue
	Else
		// Set the master key column value in the Detail row.
		If idw_Requestor.inv_Linkage.of_SetItem ( al_row, &
			inv_linkargs.is_detailcolarg[li_i], ls_coldata ) = -1 Then Return -1
	End If

Next 

// Check if the row flag should be marked New!
If ib_statusoninsertrow or of_UpdateOnRowChange() Then
	le_rowstatus = idw_Requestor.GetItemStatus(al_row, 0, Primary!)
	If le_rowstatus = NewModified! Then
		// This will convert NewModified! row to New!.
		idw_requestor.SetItemStatus(al_row, 0, Primary!, NotModified!)
	End If
End If

Return 1

end function

     
Name Owner
pfc_n_cst_dwsrv_linkage.of_undomodified pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.pfc_insertrow pfc_n_cst_dwsrv_linkage

     
Name Owner
datawindow.getitemstatus datawindow
datawindow.getrow datawindow
datawindow.setitemstatus datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.string systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_dwsrv_linkage.of_isroot pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.of_updateonrowchange pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv.of_setitem pfc_n_cst_dwsrv
pfc_n_cst_dwsrv.of_GetItemany pfc_n_cst_dwsrv

     
Full name
No Data

     
Name Scope
No Data