DataWindow.SetRelation Method (Typed) | |
Set a relation from the data server connected to this data window to the data server of another, creating an owner-child relationship between the two servers and the two windows.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD SetRelation(
oDWChild AS DataWindow,
uRelation AS USUAL,
cRelation AS STRING
) AS USUAL
public virtual Usual SetRelation(
DataWindow oDWChild,
Usual uRelation,
string cRelation
)
Request Example
View SourceParameters
- oDWChild
- Type: DataWindow
The window attached to the child server; which must be a data window linked to a server
of compatible type. If omitted, all relations for this server are removed (although the recommended way of
doing this is the DataWindow:ClearRelations() method).
- uRelation
- Type: Usual
The relation code block for the server, The name or symbol representing the field from
this server; a code block is constructed and macro-compiled or the array of field names or symbols representing
the relation for the server. The field names are concatenated with plus signs and formed into a code block which is macro-compiled.
- cRelation
- Type: String
When the relation is specified as a code block, a string version of the code block
can be provided as well; it is returned by the Relation() method.
Return Value
Type:
Usual
TRUE if successful; otherwise, FALSE.
Remarks Tip |
---|
This operation may not be supported, depending on whether the servers used supports relations and are of compatible types. The prototypical implementation is the standard Xbase DBServer:SetRelation() method provided. |
Examples
The API can take these forms:
1oDWCustomer:SetRelation(oDWOrders, {||_FIELD->CustNo},"CustNo")
2oDWCustomer:SetRelation(oDWOrders, #CustNo)
3oDWCustomer:SetRelation(oDWOrders, {#LastName,#Initial,#FirstName})
See Also