Open navdotnetreqs opened 2 months ago
This probably requires a new overload for the copy function to handle the record. There's no generic record type to cast to
Hi, I think what you are looking for is this:
var
MyTable: Record "My Table";
MyTableRecordRef: RecordRef;
MyTableRecordRef.GetTable(MyTable);
GetTable
is equivalent to Copy
.
When using a variant for generic code, there doesn't seem to be a way to differentiate between overloaded RecordRef.Copy()-function calls.
If the variant was a recordref, I could do
But in this case the variant is a Record, which is precisely why I need recref.copy.
"The call is ambiguous between the method 'Copy(var Table, [Boolean])' defined in Class 'RecordRef' by the extension '' and the method 'Copy(RecordRef, [Boolean])' defined in Class 'RecordRef' by the extension ''.AL[AL0196]"
A type "Table" does not exist and we cannot do a cast, so this can probably not be done unless the Copy-function is split into two..?