How can I get the RecordID of a Record?
crisnicolas
Member Posts: 177
I need to get the RecordID of a Record, but I haven't found the correct function to do that.
I have only found this function:
But I do not have a RecordRef, I have a Record.
Thanks for your help
I have only found this function:
RECORDID (RecordRef) Use this function to return the RecordID of the record that is currently selected in the table. If no table is selected, an error is generated. RecordID := RecordRef.RECORDID
But I do not have a RecordRef, I have a Record.
Thanks for your help
0
Answers
-
You can turn any record variable into a record ref by using the gettable/settable functions of a record ref variable.
What are you trying to accomplish in code?0 -
I'm trying to get the recordlinks of a record.0
-
I've tried this, but it is not working:
IF PurchaseHeader.HASLINKS THEN BEGIN RecRef.OPEN(DATABASE::"Purchase Header"); RecRef.SETTABLE(PurchaseHeader); PurchHeaderRecordID := RecRef.RECORDID; RecordLink.SETRANGE(RecordLink."Record ID",PurchHeaderRecordID); IF RecordLink.FINDSET THEN REPEAT MESSAGE(RecordLink.URL1); UNTIL RecordLink.NEXT = 0; END;
The SETTABLE function does not make RecRef to be positioned on the record PurchaseHeader was.... RecRef has the default values (Order,'')0 -
have you tried GetTable instead of settable?0
-
have you tried GetTable instead of settable?0
-
ooppps... yeah, that was it! thanks!0
-
Yeah I don't think the documentation on those functions is adequate. It's similar to the Get & Set property functions they had in the old VB6 days, but in reverse. GetTable gets the values from the record and puts them in the record ref, while the SetTable pushes them back to the Record variable.2
Categories
- All Categories
- 75 General
- 75 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions