Sets the table to which a Record variable refers as the same table as a RecordRef variable.
- Type: RecordRef The RecordRef for the table you want to the RecordVar to refer to.
- Type: Record The Record for which you want to specify a 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.
This example requires that you create the following variables in the C/AL Globals or C/AL Locals window.
Inventory Event Buffer
Prod. Order Component
InvtEventBuf.FIND('-'); RecID := InvtEventBuf."Source Line ID"; RecRef := RecID.GETRECORD; RecRef.SETTABLE(ProdOrderComp);