NAV strange behaviour when doing a get()

txeriff
Member Posts: 515
Hi Mates,
I hope you all right.
A colleague and I are a bit surprised with this:
I´ve got some strange behaviour (see attached screen)
For some reason get() for rec37extendida.get does not work unless you set the values into code and integer variables.
vCode:=Rec37."Document No.";
vLineNo:=Rec37."Line No.";
This has been tested in clean cronus database, NAV2009R2 build 32012.
any ideas,
thanks!
Edit:
if any1 wants to try, find the extended table here:
https://ufile.io/1mats
Piece of code:
I hope you all right.
A colleague and I are a bit surprised with this:
I´ve got some strange behaviour (see attached screen)
For some reason get() for rec37extendida.get does not work unless you set the values into code and integer variables.
vCode:=Rec37."Document No.";
vLineNo:=Rec37."Line No.";
This has been tested in clean cronus database, NAV2009R2 build 32012.
any ideas,
thanks!
Edit:
if any1 wants to try, find the extended table here:
https://ufile.io/1mats
Piece of code:
BuscaCampoTablaExtendida(RecRef : RecordRef;Texto : Text[50];VAR Devuelve : Variant) CASE RecRef.NUMBER OF 36:BEGIN RecRef.SETTABLE(Rec36); IF rec36Extendida.GET(Rec36."Document Type", Rec36."No.") THEN BEGIN CASE Texto OF 'TextoIdioma':Devuelve := rec36Extendida."Posting Description Language"; END; END; END; 37:BEGIN RecRef.SETTABLE(Rec37); //Rec37.SETRECFILTER; vCode:=Rec37."Document No."; vLineNo:=Rec37."Line No."; //try replacing vcode and vlinenno by Rec37."Document No." and Rec37."Line No." and it wont work IF rec37Extendida.GET(Rec37."Document Type", vCode,vLineNo) THEN BEGIN MESSAGE('ok'); CASE Texto OF 'TextoIdioma':Devuelve := rec37Extendida."Description Language"; END; END; END; END;
0
Answers
-
Maybe stupid question but in the line that is commented out you are using the document type invoice but in the other one you are using the document type of the sales line, could you be overseeing something there? Otherwise I've seen sometimes some hidden values in fields, for instance when pasting values into fields return characters come with them, maybe that could be the case?0
-
Maybe stupid question but in the line that is commented out you are using the document type invoice but in the other one you are using the document type of the sales line, could you be overseeing something there? Otherwise I've seen sometimes some hidden values in fields, for instance when pasting values into fields return characters come with them, maybe that could be the case?
Hi,
The line commented out was a trial of hardcoding some fields.
If you look at the example in screen capture, I use "document type" from T37 in the first column of the get(). Extended table "document type" its been copied from source, I just compared optionstring for both tables.
0 -
Your rec37extendida has probably 4 fields in primary key, so GET should use all primary key fields.
1 -
Your rec37extendida has probably 4 fields in primary key, so GET should use all primary key fields.
It´s an "extended table" with the same key fields. We compared this already here.
If any1 would like to try, Find table attached:
https://ufile.io/1mats
Function to be called:BuscaCampoTablaExtendida(RecRef : RecordRef;Texto : Text[50];VAR Devuelve : Variant) CASE RecRef.NUMBER OF 36:BEGIN RecRef.SETTABLE(Rec36); IF rec36Extendida.GET(Rec36."Document Type", Rec36."No.") THEN BEGIN CASE Texto OF 'TextoIdioma':Devuelve := rec36Extendida."Posting Description Language"; END; END; END; 37:BEGIN RecRef.SETTABLE(Rec37); //Rec37.SETRECFILTER; vCode:=Rec37."Document No."; vLineNo:=Rec37."Line No."; //try replacing vcode and vlinenno by Rec37."Document No." and Rec37."Line No." and it wont work IF rec37Extendida.GET(Rec37."Document Type", vCode,vLineNo) THEN BEGIN MESSAGE('ok'); CASE Texto OF 'TextoIdioma':Devuelve := rec37Extendida."Description Language"; END; END; END; END;
0 -
Table 37 has 3 key fields, Document Type,Document No.,Line No. If rec37Extendida is a copy of that, you have to use all 3 fields in the GET command. It's strange that it seems to work if you use just 2 variables, because it shouldn't work at all.0
-
Table 37 has 3 key fields, Document Type,Document No.,Line No. If rec37Extendida is a copy of that, you have to use all 3 fields in the GET command. It's strange that it seems to work if you use just 2 variables, because it shouldn't work at all.
Shit i sent wrong table, sorry about that. I was busy with other topics and...
Its lines...
you call from SL subform to:
RecRef.GETTABLE(Rec);
CU.BuscaCampoTablaExtendida(RecRef, 'TextoIdioma', TextoIdioma);
I updated the link with t37.
0 -
Any1?0
-
I already told you, your table has a primary key of 3 fields, you are only using 2 values in your get command.0
-
I already told you, your table has a primary key of 3 fields, you are only using 2 values in your get command.
In my get I use 3 of em:
37:BEGIN
RecRef.SETTABLE(Rec37);
//Rec37.SETRECFILTER;
vCode:=Rec37."Document No.";
vLineNo:=Rec37."Line No.";
//try replacing vcode and vlinenno by Rec37."Document No." and Rec37."Line No." and it wont work
IF rec37Extendida.GET(Rec37."Document Type", vCode,vLineNo) THEN BEGIN
How come this works and this does not?
IF rec37Extendida.GET(Rec37."Document Type", Rec37."Document No.";,Rec37."Line No.";) THEN
0 -
I'm sorry, I somehow overlooked several times that you are indeed using all 3 values. Shame on me!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