Hi! I have a question. My code returns table name and assigns it to text variable, i.e.: vtab := “Fixed Asset”; It can be any Attain table… What should I do to declare vtab as a Record? Then I want to write something like vtab.SETRANGE(vtab.SomeField, SomeValue); I think that: 1) it’s impossible; 2) it’s connected with variant variables (ISRECORD), but i have no detailed docs about this variable type. Can you help me?
The short answer is : It’s currently impossible. Dynamical allocation of the “items” (Fields and Tables as per your SETRANGE example) you want to manipulate cannot be done. ###### firstname.lastname@example.org
If you are talking about 3.6 version then you can user recordref to point to any table.it acts just like a pointer to the whole record but not to individual fields. well there is a solution but very round about.I will release it soon …if not exactly what you want it may be worth… Lakshmi Valluru
I know about 3.60, but currently I deal with 3.10. Are you sure it’s impossible to use variant variables? Where can I find info on them?
To my knowledge ‘NO’ Lakshmi Valluru
Hi As far as assignament is concerned, you can assign an record to a variant variant varible, but u cant use the general functions on record to that varible Bye
With 3.10 this is indeed impossible since all table access via record variables is bound statically by the declaration of the variable. This is what RecordRef/FieldRef etc is primarily there to address. The Variant does not help. Variants really dont provide functionality, but are just a means to provide typless variables across interfaces. They do not assume the functionality of the type they have been cast to. Sorry.
There is a solution, but it is messy: Create an OCX. In that OCX, use C/FRONT to access the tables that you want, and write the code you need in C++ (VB or What ever). Then call the OCX from within Navision. I have done this before, but I would not do it again, I would just manually write lots of code in C/Side next time. By the way, you will spend a lot of time working with the COMMIT and GETCURRENTVERSION functions to make it all work. _________________________ David Singleton Navision Consultant since 1991 email@example.com___________