[quote user="kkrtsv"]
Inge M. Bruvik, Teddy Herryanto
Thanks for your answers, recordref is a helpfull workaround like a variant.
But it is not the answer.
To be honest I don't know why this question is so difficult. =(
We already have the method "Page.SetRecord" in the core, but nobody can explain how it works.
This method does not use variant or recordref, this method accepts any record and only record.
Just look on this example:
procedure Example()
var
somePage: Page "Customer Card";
rec1: Record Customer;
rec2: Record Item;
rec3: Record "Incoming Document";
begin
somePage.SetRecord(rec1);
somePage.SetRecord(rec2);
somePage.SetRecord(rec3);
end;
All three lines are correct. It does not require any specific table we can pass any.
And this code will be successfully compiled.
[/quote]
The example you should does not accept any record. It only accept record of the type Customer with any filter applied to it. And that is no problem to get working as long as you know what record type you send.
In the function you only have to declare t he record parameter as VAR.
procedure customer (var customer: Record Customer)
begin
end;
But if you do not know what kind of record you will pass to the function then you will have to use record ref.