SETTABLE Function (RecordRef)
Sets the table to which a Record variable refers as the same table as a RecordRef variable.
Syntax
RecordRefVar.SETTABLE(RecordVar)
Parameters
RecordRefVar
Type: RecordRef
The RecordRef for the table you want to the RecordVar to refer to.
RecordVar
Type: Record
Specifies the Record that you want to refer to the table.
Remarks
Any filters that are applied to the RecordRef are also applied to the Record. If you change the filter that is applied to the RecordRef, you must call SETTABLE again to apply the new filter to the Record.
Example
This example shows that if you have a RecordID data type, you can get a RecordRef for the table that the RecordID refers to. Then you can use the RecordRef to set the table to which a Record variable refers.
This example requires that you create the following variables in the C/AL Globals or C/AL Locals window.
Variable name | DataType | Subtype |
---|---|---|
InvtEventBuf | Record | Inventory Event Buffer |
RecID | RecordID | Not applicable |
RecRef | RecordRef | Not applicable |
ProdOrderComp | Record | Prod. Order Component |
InvtEventBuf.FIND('-');
RecID := InvtEventBuf."Source Line ID";
RecRef := RecID.GETRECORD;
RecRef.SETTABLE(ProdOrderComp);