RecordRef.GETTABLE vs. RecordRef.SETTABLE

Slawek_Guzek
Member Posts: 1,690
Who knows the difference ?
Regards,
Slawek
Regards,
Slawek
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
0
Comments
-
Regarding the on-line help, the SETTABLE will apply filters from the record to the recordref too. GETTABLE will set only the table.0
-
Yes Kine. I've checked in on-line help as well. And did some tests before asking question here.
According to my tests both SETTABLE and GETTABLE copy filters from record to recordref.
Just wonder if anyone knows real difference between those two functions...
Regards,
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Actually, the help is wrong (I didn't check the help of NAV2009 though).
In reality GETTABLE is for putting a record-variable into a recordreference and SETTABLE does the opposite.
If you put a record into a recordreference, it also copies the filters.
If you put a recordreference into a record, it doesn't! (I didn't check NAV2009 though).Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Slawek Guzek wrote:Yes Kine. I've checked in on-line help as well. And did some tests before asking question here.
According to my tests both SETTABLE and GETTABLE copy filters from record to recordref.
Just wonder if anyone knows real difference between those two functions...
Regards,
Slawek
Ok, didn't know that. But just looking on the function names I assumed what Kriki described, but I know that the SETTABLE is not working as I will assume. Thus I looked into on-line help.
To set filters to record I am using the Rec.SETVIEW(RecordRef.GETVIEW).0 -
NAV2009:
help has been fixed, functionality hasn't been(i tested it with this code, from a kriki tip&trick)
I tested it with both setrange and setfilter (who knows if this could change something?) without success.
what a shame...TBSalesInvHead.SETFILTER("Your Reference",'12'); rer[1].GETTABLE(TBSalesInvHead); rer[2].GETTABLE(TBSalesCrMemoHead); recField[1].RESET; recField[1].SETCURRENTKEY(TableNo,"No."); recField[1].SETRANGE(TableNo,DATABASE::"Sales Invoice Header"); IF recField[1].FINDSET THEN REPEAT IF recField[2].GET(DATABASE::"Sales Cr.Memo Header",recField[1]."No.") THEN IF (recField[1].FieldName = recField[2].FieldName) AND (recField[1].Type = recField[2].Type) AND (recField[1].Len = recField[2].Len) AND (recField[1].Class = recField[2].Class) AND (recField[1].Enabled = recField[2].Enabled) THEN BEGIN fir[1] := rer[1].FIELD(recField[1]."No."); fir[2] := rer[2].FIELD(recField[2]."No."); fir[2].SETFILTER(fir[1].GETFILTER); END; UNTIL recField[1].NEXT = 0; rer[2].SETTABLE(TBSalesCrMemoHead); MESSAGE(TBSalesCrMemoHead.GETFILTERS); MESSAGE(TBSalesInvHead.GETFILTERS);
0 -
Belias wrote:NAV2009:
help has been fixed...
SETTABLE Function (RECORDREF):
Any filters that are applied to the recordref are also applied to the record. If you change the filter that is applied to the recordref, you must call SETTABLE again to apply the new filter to the record.
In fact, no filter is transferred at all from a recordref to a record.
So it seems that neither online help nor the bug has been fixed (though it would have been sufficient to fix one of them, not both). This is true for NAV 2009 SP1, too.
New kits on the blog: https://massivedynamicsblog.wordpress.com0 -
If you put a recordreference into a record, it doesn't - then you have to use SET AND GETVIEW.
JobRec.SETVIEW(MyRecordRef.GETVIEW);
Then you also have the filters.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