Variant and Record Fields

hi I am using Navision Attain-3.10. how can i access the fields of a record if i have assigned it to a Variant Data Type. I have made a Variable VarData Type as Varaint and assigned a Customer record as follows VarData :=CustRec; When i print the value using MESSAGE(’%1’,VarData), It shows all the values contianed in the record but i am confused how can i get the individual field Values.Or how can i modify some fields of the record that is in the Variant. with regards harikesh

Why do you need to make it in Variant? You can convert Variant back to Record and read/write data to fields you want.

hi Arthur i want to make a generic function which will accepet a Variant type parameter which can contians a customer, Item , location etc many other record type. Then i want to write the data to a TExt file. suppose If i have 50 table, i have to make fifty functions or if i pass the table id then also it gives problem as all the table contains differnt fields. and using a case is not a good idea i suppose so i wanted to pass the record as a variant and then write it to the text file which will shorten my code by miles i guess now it is clear what i want to do With regards Harikesh

If you work on 3.60 you can use RecordRef and FieldRef. This will solve your problem. I don’t see other way.