Change field values

StGro
Member Posts: 13
Hello,
I need to fill a temp. table with lots of fields gathered from a few tables.
I´m talking about 40 fields.
I guess my code will look like:
I bet there is no better way then typing a procedure like this?
I think of something like going through a loop and copying fields by their id, or even better: a function alá "copy all field from table2 to table1, skip not existing fields in table1"
Any suggestions?
Regards,
Steffen
I need to fill a temp. table with lots of fields gathered from a few tables.
I´m talking about 40 fields.
I guess my code will look like:
field1 := table1.field1; field2 := table1.field2; field3 := table1.field3; field 4 := table2.field; ...
I bet there is no better way then typing a procedure like this?
I think of something like going through a loop and copying fields by their id, or even better: a function alá "copy all field from table2 to table1, skip not existing fields in table1"
Any suggestions?
Regards,
Steffen
0
Comments
-
StGro wrote:a function alá "copy all field from table2 to table1, skip not existing fields in table1"
This do TransferFields, but it is based on fields Nos. and if you have same nos. in Table2 and Table3, the fields will be overwritten (and there will be problem if one field with no. XX will be Text in one table and decimal in another...)
But in this case I think that "hardcoded" C/AL := lines will be best (clear code and easy extendable)...0 -
From V3.60 you can use Record and Field-references.
Attention : In V3.60 there is a bug with the field-reference to a decimal : the decimal will be rounded to 4 decimals. This is fixed in 3.70.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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