Get Record Field value by Field Name

Inrego
Member Posts: 9
Hey there. I'm trying to dynamically retrieve a field value from a record. Lets say for example I have the field name 'Phone No.' stored as a string in a variable. How can I use this string to get the value of the field with that name from a record?
For example, in C# I would use reflection - but I've no idea how to do it in C/SIDE
For example, in C# I would use reflection - but I've no idea how to do it in C/SIDE
0
Comments
-
Hi,
You can use the datatypes RecordRef and FieldRef for this.
A RecordRef has a member FIELDCOUNT. Also there is a member called FIELDINDEX that will, based on an index (from 1..FIELDCOUNT), return a FieldRef
A FieldRef has a NAME property that you can check against your variable content.
When you've found the field, you can access the VALUE of that FieldRef (You may need to check the TYPE)
Jan Veenendaal0 -
Thank you! I found an article that goes in depth with this method.
For reference to other users coming here: http://www.archerpoint.com/blog/Posts/j ... namics-nav0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions