[Unsolveable] Evaluate Time or DateTime to a FieldRef (3.60)

Arjan_Somers
Member Posts: 64
Hi all,
I'm using fieldrefs to fill a record.
To source value is 'text' so i need to use an evaluate function to convert the string to a Time variable.
Since there is no evaluate function for fieldRef's i used a function i found somewhere here on this forum. It works for all data type except for Time or DateTime variables. It crashes, or wrong values are entered into the fields.
This is a piece of code i use:
The MessageBoxes displays a correct date and time.
Could this have anything to do with the fact that RecordRef uses variant datatypes, and there is no Variant type for Time?
But more important: Does anybody know a solution??
I'm using fieldrefs to fill a record.
To source value is 'text' so i need to use an evaluate function to convert the string to a Time variable.
Since there is no evaluate function for fieldRef's i used a function i found somewhere here on this forum. It works for all data type except for Time or DateTime variables. It crashes, or wrong values are entered into the fields.
This is a piece of code i use:
'TIME': IF EVALUATE(DummyTime,FromText) THEN BEGIN MESSAGE('%1: %2', ToFieldRef.CAPTION, DummyTime); ToFieldRef.VALUE := DummyTime; EXIT(TRUE); END; 'DATETIME': IF EVALUATE(DummyDateTime,FromText) THEN BEGIN MESSAGE('%1: %2', ToFieldRef.CAPTION, FromText); ToFieldRef.VALUE := DummyDateTime; EXIT(TRUE); END;
The MessageBoxes displays a correct date and time.
Could this have anything to do with the fact that RecordRef uses variant datatypes, and there is no Variant type for Time?
But more important: Does anybody know a solution??
0
Comments
-
I investigated some more and found the following info:
We are using Attain 3.60 W1, wich means we are using the by Microsoft edited version of 3.6.
According to the 3.60 changelog this is also the first version wich included recordRef's.
I also read somewhere on the inet that they changed the way RecordRefs work in 3.70.
The code i refferred to is for 3.70.
So my guess is that they fixed this error in 3.70, but i can't find a 3.70 changelog.
So my questions are:
1. Can someone confirm this? (Does anyone have 3.70, and would look it up in the changelog for me)
2. Is there a workaround for version 3.60??0 -
Nobody? ](*,)0
-
Can't confirm it in detail, but I started developing with RecRefs in 3.60 and found many problems like you described. Just make a technical update to 3.7, and RecRefs work like documented (well, in most cases
).
Alex0 -
Too bad...
I fixed it for now using normal Rec's and a huge case statement.
Thx for your reply anyways..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