Usage of RECORDID and GETRECORD
ta5
Member Posts: 1,164
I have a kind of Log table. The idea is to keep that generic, so when I want to log something from a given record, I use a RECORDID.
In another place I want to retrieve the logged record, in the example this would be a given Contact. For that, I use GETRECORD.
But something does not work here. When using the record with MESSAGE, all fields but the key fields are empty.
Any ideas?
Thanks in advance
Thomas
In another place I want to retrieve the logged record, in the example this would be a given Contact. For that, I use GETRECORD.
But something does not work here. When using the record with MESSAGE, all fields but the key fields are empty.
Any ideas?
Thanks in advance
Thomas
// Writing the Log for a Contact Record
myRecRef.GETTABLE(Contact)
myLog.RecordDetails := myRecRef.RECORDID; //saving the reference for a given Contact record
// Reading the Log
...
myRecID := myLog.RecordDetails ;
MyRecRef := myRecID.GETRECORD;
MESSAGE('FIELD 1\Field 2 %2',MyRecRef.FIELD(1).VALUE,MyRecRef.FIELD(2).VALUE);
0
Best Answers
-
CU423 change log managment: LogModification might help.
RecRef.GET(myLog.RecordDetails);
FldRef := RecRef.FIELDINDEX(1);
MASSAGE(FldRef.VALUE);
5 -
@ta5
Your code could be like this:// Writing the Log for a Contact Record MyRecRef.GETTABLE(Contact); MyLog.RecordDetails := MyRecRef.RECORDID; //saving the reference for a given Contact record // Reading the Log ... MyRecRef.GET(MyLog.RecordDetails); MESSAGE('FIELD 1 %1\Field 2 %2', MyRecRef.FIELD(1).VALUE, MyRecRef.FIELD(2).VALUE);
5
Answers
-
I believe you just need to add MyRecRef.FINDFIRST, that should populate the record.
0 -
Thanks for commenting.
FINDFIRST does not help, unfortunately.
I use NAV 2013R2.
Any other ideas? Would be great!0 -
CU423 change log managment: LogModification might help.
RecRef.GET(myLog.RecordDetails);
FldRef := RecRef.FIELDINDEX(1);
MASSAGE(FldRef.VALUE);
5 -
@ta5
Your code could be like this:// Writing the Log for a Contact Record MyRecRef.GETTABLE(Contact); MyLog.RecordDetails := MyRecRef.RECORDID; //saving the reference for a given Contact record // Reading the Log ... MyRecRef.GET(MyLog.RecordDetails); MESSAGE('FIELD 1 %1\Field 2 %2', MyRecRef.FIELD(1).VALUE, MyRecRef.FIELD(2).VALUE);
5 -
Hello Nabil and John
GET did the trick. Thanks a lot. I was not aware of that kind of usage of the GET command.
Thanks again, you made my day!
Thomas0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
