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

Arjan_SomersArjan_Somers Member Posts: 64
edited 2006-08-02 in Navision Attain
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:
  '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??

Comments

  • Arjan_SomersArjan_Somers Member Posts: 64
    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??
  • Arjan_SomersArjan_Somers Member Posts: 64
    Nobody? ](*,)
  • AKAK Member Posts: 226
    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 :wink: ).

    Alex
  • Arjan_SomersArjan_Somers Member Posts: 64
    Too bad...

    I fixed it for now using normal Rec's and a huge case statement.

    Thx for your reply anyways..
Sign In or Register to comment.