RecordRef.SetTable(Record) Method
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.
Syntax
RecordRef.SetTable(Rec: Record)
Parameters
RecordRef
Type: RecordRef
An instance of the RecordRef data type.
Rec
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.
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;
See Also
RecordRef Data Type
Get Started with AL
Developing Extensions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for