Variant - Experimental Data Type in 3.60??

Hi, just a short question is it a bug that TRANSFERFIELDS and COPY don’t work with Variant Datatype?? (Navision Attain 3.60) I tried following: [Variant] := Table; Table.TRANSFERFIELDS([Variant]); the same with copy produces an access violation. Regards, Stefan

From help: Record.TRANSFERFIELDS(FromRecord [, InitPrimaryKeyFields]) Record Data type: record The record to copy the contents of the fields in FromRecord to. FromRecord Data type: record The record from which to copy. InitPrimaryKeyFields Data type: Boolean Default value: True As you can see, it’s only for Record type variables !!!

Oh … i thought it should recognize that the variant includes a record now … Thanks anyway

It recofnizes with var.ISRECORD but you can’t modify it or use as Record type variable.

Variant is not a field datatype Transferfields and copy works with the transfering of data from one to another table in which variant is not there … variant is a C/AL variable datatype.

I understand what he is saying, The program is made in such a way that you would expect to be able to do this. If navision allowed you to declare variables in CODE youd have a real language, but it only allows you to set a VARIANT(The type youd expect) from the Global or Local Variable windows. ie. If I say MyTable is a Table I can reference MyTable and all of its objects. But if I say MyVariant is MyTable (Via Code & Not via the Global panel which its incapable of doing) It does nothing. PS. I think this is a limitation of the language and not a feature of it!