Options

Easy Basic Questions about table views

Manuel_A.Manuel_A. Member Posts: 22
edited 2004-03-18 in Navision Financials
Hello.

Im new to programming and today i got my first project. Ive got a very simple question i guess. I hope no one minds about basic questions?

I have created my own table and form. Now i want to access another table (Employees).

I want to select the Employee Code and then want to automatically update some fields like First Name and Lastname with the content of the selected Code.

What do i have to do ?

Thanks for your answer.

Comments

  • Options
    Dean_AxonDean_Axon Member Posts: 193
    There are 2 main ways to do this and it will depend on what elements of the primary key you are able to specify. In this case the primary key is "no." so you could use the GET command:
    specify a variable:

    Emp REC 5200

    On Validate () of the employee Code
    Emp.Get("Employee Code");
    "First name":=Emp."First name";
    "Last name":=Emp."Last Name";
    Your second option is if you cannot specify all the fields required for the primary key :
    specify a variable:

    Emp REC 5200
    On Validate () of the employee Code
    Emp.Setrange("Employee Code");
    if Emp.Find('-') then begin //find first record match
    "First name":=Emp."First name";
    "Last name":=Emp."Last Name";
    end;

    Hope that helps.

    Dean :D
    Remember: Keep it simple
  • Options
    DenSterDenSter Member Posts: 8,304
    Or, if you don't need the ability to change the other fields (if they are for information only), you should make the other fields flowfields that lookup into your employee table, and Navision will update those automatically.
  • Options
    Manuel_A.Manuel_A. Member Posts: 22
    Thanks for your help!

    Now i can continue working on the project till my next problem ;)
Sign In or Register to comment.