How to get the current field?

ufuk
Member Posts: 514
Hi,
I am trying to log the modifications in Item table and our license does not include Change Log Management. I have checked Change Log Management but I could not exactly understand the way to get the current field and begin a loop between fields.
Is there a simple way to get the current field no.?
Regards.
Ufuk
I am trying to log the modifications in Item table and our license does not include Change Log Management. I have checked Change Log Management but I could not exactly understand the way to get the current field and begin a loop between fields.

Is there a simple way to get the current field no.?
Regards.
Ufuk
Ufuk Asci
Pargesoft
Pargesoft
0
Comments
-
plz use FIELDREF data type FieldRef.NAME or FieldRef.NumberRegards,
GD0 -
ufuk wrote:Hi,
I am trying to log the modifications in Item table and our license does not include Change Log Management. I have checked Change Log Management but I could not exactly understand the way to get the current field and begin a loop between fields.
Is there a simple way to get the current field no.?
Regards.
Ufuk
First you need to purchase the granule.David Singleton0 -
plz use FIELDREF data type FieldRef.NAME or FieldRef.Number
Can you give an example? When I tried using fieldref datatype, it gives an error as it could not be initialized.Ufuk Asci
Pargesoft0 -
you have to initialize fieldref from recordref.FIELD function
rf.OPEN(DATABASE::item); message('The %1 table contains %2 records', rf.CAPTION, rf.COUNTAPPROX); fr := rf.FIELD(3); message('The %1 field has %2 length', fr.NAME, fr.LENGTH);
Regards,
GD0 -
Use the FieldNo and FieldName to perform the same. for example
ItemHistRec."Field ID":=FIELDNO("New Name"); This will give you the fieldno. now use the field name to get the name, and you can create the history of the modifications that you make in the item table.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
ItemHistRec."Field ID":=FIELDNO("New Name"); This will give you the fieldno. now use the field name to get the name, and you can create the history of the modifications that you make in the item table.
Thanks, but in this case you have to manually give the field name. I can use FIELDNAME instead of FIELDNO when using the field name as parameter (this is what I am now temporarily using):D
But I want something like this: On the Modify trigger of the item table, get the fieldno modified (without using a parameter like name etc.), find it in the fields table and insert the modification description and the above field name in my change log entry.Ufuk Asci
Pargesoft0 -
rf.OPEN(DATABASE::item);
message('The %1 table contains %2 records',
rf.CAPTION, rf.COUNTAPPROX);
fr := rf.FIELD(3);
message('The %1 field has %2 length',
fr.NAME, fr.LENGTH);
Thanks gulamdastagir. This works fineUfuk Asci
Pargesoft0
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