Step through fields in a table via Fieldref and recref

jensthomsen
Member Posts: 173
I want to step through all the fields in a table, to see where there are any data (across companies in a database). I'm aware that Fieldref and RecRef can do the trick, but how?
0
Comments
-
1) If there is some record, there are some data (you cannot say that if the field is empty, that there is no data, or if in integer is 0, it means no data..., if some record exists, there are data...)
2) If there is some record in the table you can find out in File-Database-Informations-Tables
3) This table is "across companies".0 -
kine wrote:1) If there is some record, there are some data (you cannot say that if the field is empty, that there is no data, or if in integer is 0, it means no data..., if some record exists, there are data...)
No, I want to check it on field basis: If the datattype is Date, the field isn't empty if the fieldvalue <> 0D, if the type code the field isn't empty if it <>'' etc.0 -
sample of mine.
declare this variables:
item as record subtype item
refItem as recordref
fldItemFields as fieldref
Ctr as integer
tmpClass as Text 100
tmpType as text 200
tmpValue as text 1024IF Item.FIND('-') THEN REPEAT refItem.GETTABLE(Item); FOR Ctr := 1 TO refItem.FIELDCOUNT DO BEGIN fldItemFields := refItem.FIELDINDEX(Ctr); tmpClass := FORMAT(fldItemFields.CLASS); tmpType := FORMAT(fldItemFields.TYPE); tmpValue := fldItemFields.VALUE; MESSAGE(tmpClass); MESSAGE(tmpType); MESSAGE(tmpValue); END; UNTIL Item.NEXT = 0;
Navision noob....0
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