RecordRef in 3.60

Hi there, In the documentation of Attain 3.60 I see that it should be possible to use a recordref to open a table. It states that it should be done like: Ok := RecordRef.Open(Tablenumber). If I try to open the customer table like bOk := refRecord.Open(18), it returns a False no mather what I try. Has anyone been able to use this functionality or nows where to find more information on this topic? Regards, Leon Raafs

I’ve used it, but I learned it with try&error, so I can’t tell you where to find information about it. But your code should work, if your variable RecordRef is declared as type “RecordRef”. May be you forgot this…

Is there a way to have a form work on sucht a recref variable ?

You mean something like FORM.RUN(FormID,RecRef)? Unfortunately the answer is no :-(. May be in the next version…

The variable is declared as a RecordRef. Still it returns a false if I try to open a table. I tried with different tables, but the result stays the same. Any ideas? Regards, Leon Raafs

I just tried the first time to retrieve the return value for, and it returns false too. But the temporary table is created and I can refer to fields, retrieve and write data and so on. Seems that the return value is false, even if the table was opened. Ether an error in the documentation or in the function itself, but in spite of this works. Just try it without the return value.

It looks like you are right Alex. I tried to get the caption of the recordref before and after the open statement. Before generated an error, after the open statement it worked just fine. Looks like a bug to me.

Don’t waste to much time on recref yet, It’s still to buggy in 3.60. In the new release more functions and other stuff will be available for recref too.

Unfortunatly this is not an option Emiel, I’m working on a solution that depends on the record and fieldref posibility. To bad that there is so little documentation on this subject Regards, Leon Raafs

In that case, here is it: MESSAGE('%1',recRef.OPEN(18)); // table Customer reRef.FIND('-'); recField := recRef.FIELD(1); // field No. Message('%1', recField.VALUE); **Output** No 10000 Seems like the return value of the recRef.OPEN() does not work. However the table is opened. Please tell me why you need to know wether opening the table worked or not. Maybe we can find you an other solution to figure this out.

In 3.70, RecordRef.OPEN no longer returns a value and the documentation has changed to reflect this.

That’s one way to solve this problem [;)]