Referencing Table fields via variables

I am looking to get the value of a field in a table using a variable to refer to the name. Instead of var := SalesLine.“Document Type”; I want to say FieldName := ‘Document Type’; and then use the SalesLine and FieldName variables. This is simple in Access/VB, but is it possible in Navision? I would even be happy with being able to get the value of the field using the Field Number. Thanks in advance.

Hi Chris Sorry but as far as I can see, this is not possible in the current version (2.50) This is HIGHLY requested by several danish NSC’s. It worked just fine in the old blue version, but it dissapered in NF. Rumours say though that it soon will work again :slight_smile: Palle Arentoft, Team Manager Aston Naviteam A/S Denmark Email : par@astonitgroup.com

There is a workaround for that. With C/FRONT there is a function that does just that. This workaround works only if used in a C/S environment. from C/AL, you define a variable of type OCX, value C/FRONT OXC. Then you initiate a new connection to the database and get the fieldname. The function takes a tablename and fieldnumber… Hope this can help you, Dennis Decoene Navision Developer Top-IT Molenhuisstraat 2a 9800 Deinze Belgium

To Dennis_Decoene. I need something you are describing, but please give me more details, I do not understand what realy to do.

Dennis, I think what you are saying here is that I can get the fieldname if I have the table name and field number. This could also be done using the Field table without using the OCX. What I am interested in doing is looping through each field and look at the value of that field via code. Thanks for your insights.