SETRANGE does not apply

poppins
Member Posts: 647
Hi everyone,
I have some troubles with the following piece of code:
The output is:
As you can see, SETRANGE does not apply :?
Where is the error??? What should I do???
I have some troubles with the following piece of code:
MyRecord.RESET; MyRecord.SETRANGE(DetailEvalTemp.Year,TempYear); MESSSAGE('The selected year is = %1', TempYear); MESSSAGE('So the year is = %1', DetailEvalTemp.Year);
The output is:
The selected year is = 2011 So the year is =
As you can see, SETRANGE does not apply :?
Where is the error??? What should I do???
0
Comments
-
What about
MyRecord.RESET; MyRecord.SETRANGE(DetailEvalTemp.Year,TempYear); IF MyRecord.FINDFIRST THEN; MESSSAGE('The selected year is = %1', TempYear); MESSSAGE('So the year is = %1', DetailEvalTemp.Year);
0 -
Infact, there was a little error:
MyRecord.SETRANGE(MyRecord.Year,TempYear);
and thank you, now it applies...0 -
poppins wrote:Infact, there was a little error:
MyRecord.SETRANGE(MyRecord.Year,TempYear);
and thank you, now it applies...
It is always prefered to useMyRecord.SETRANGE(Year,TempYear);
0 -
mohana_cse06 wrote:It is always prefered to use
MyRecord.SETRANGE(Year,TempYear);
As it so happens, I like SETRANGE over SETFILTER too, but this 'preference' you talk about is purely our own personal preference.0 -
DenSter wrote:mohana_cse06 wrote:It is always prefered to use
MyRecord.SETRANGE(Year,TempYear);
As it so happens, I like SETRANGE over SETFILTER too, but this 'preference' you talk about is purely our own personal preference.
Poppins and me didnt use SETFILTER word in our posts at all..
How did you think of that? :-k
The preference I am talking about is
MyRecord.SETRANGE(Year,TempYear);
MyRecord.SETRANGE(MyRecord.Year,TempYear);0 -
Again, this is YOUR personal preference, there is no technical reason to do it either way. There is nothing wrong with that code.
Although I also don't like the repetition, they both work exactly the same.0 -
You also dont assume yourself which others didnt say...0
-
-
DenSter wrote:last word0
-
mohana_cse06 wrote:DenSter wrote:last word0
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