How to link up form and table [ typical situation ]?

p_vikas_goudp_vikas_goud Member Posts: 16
Hi experts,

I am new to Navision,please help me with problem

I created a form which consists of three fields, 1.Citycode(code datatype)
2.Place(Text) and 3.Distance(Int)

I want to get when I type Citycode, i should get Place and Distance filled automatically

Just as like when we give Postcode in Customer Card, City name is filled automatically.

I tried trying the same code as like customer card, but it not working,

please help me with this
goood

Comments

  • matttraxmatttrax Member Posts: 2,309
    Did you create a table too?

    You should probably have those three fields in a table. Then in the OnValidate trigger of the CityCode field you should have code that goes and looks up or calculates the other fields.

    Usually the syntax is something like
    OtherRecord.GET("CityCode");
    Place = OtherRecord.Place;
    

    I understand what you are trying to do, but I think we need more detail about your design.
  • p_vikas_goudp_vikas_goud Member Posts: 16
    Thanks matttrax, for helping me in the problem, the solution which you gave is working.

    Now ,please help me with the second situation

    1.How can I show the system time on the Form?

    What ways can I show 12hrs format and 24 hrs format?

    What I am doing with this type of questions is

    I am devoloping a project in prepaid taxi reservation system, where if the time is between 11:00PM to 05:00AM the bill shows 50% more than the actual value.

    All sugesstions are welcomed
    goood
  • NagiNagi Member Posts: 151
    Hi,

    You retrieve the system time using the TIME function. If you want to use this on a form where TIME is constantly updated to show the current time, I think you have to use the timer property of the form. You could set the TimerInterval to 1000 (=milliseconds) and then have a variable in the timer which takes its value from TIME, and then after that you update the controls on the form.

    I haven't tried it, but it would look something like this I think..

    // Put this in TimerInterval trigger
    Variable := TIME;
    CurrForm.UPDATECONTROLS;
    // END

    You can use FORMAT to display different formats of TIME. You can call FORMAT like this.. FORMAT(TIME,#,#) where # is a single number. The first # indicates how many characters of TIME should be shown and the second # gives a different format. You can use the MESSAGE functions to test the different formats...

    //Just an example
    MESSAGE('%1',FORMAT(TIME,4,1);

    Once again, I haven't tried this out, but I think this is at least one way to solve your problem.

    Cheers!
Sign In or Register to comment.