title | description | ms.author | ms.date | ms.topic | author |
---|---|---|---|---|---|
RecordRef.SetTable(Record) Method |
Sets the table to which a Record variable refers as the same table as a RecordRef variable. |
solsen |
07/07/2021 |
reference |
SusanneWindfeldPedersen |
Version: Available or changed with runtime version 1.0.
Sets the table to which a Record variable refers as the same table as a RecordRef variable.
RecordRef.SetTable(Rec: Record)
RecordRef
Type: RecordRef
An instance of the RecordRef data type.
Rec
Type: Record
Specifies the Record that you want to refer to the table.
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.
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.
var
RecRef: RecordRef;
InvtEventBuf: Record "Inventory Event Buffer";
RecID: RecordId;
ProdOrderComp: Record "Prod. Order Component";
begin
InvtEventBuf.Find('-');
RecID := InvtEventBuf."Source Line ID";
RecRef := RecID.GetRecord;
RecRef.SetTable(ProdOrderComp);
end;
RecordRef Data Type
Get Started with AL
Developing Extensions