[Forms - Tables - LookUps] Show other Field than PrimaryKey

Jens_MurerJens_Murer Member Posts: 6
edited 2004-01-26 in Navision Attain
Hello.

I hope anyone can (and will) help me - fast :o)

I have 2 tables:
One containing movies, with a PrimaryKey 'OID' and - of course - the title of the movie,
the other one for storing shows in a cinema, in which the movie which is shown should be stored by a relation between the ForeignKey 'MID' in the show table and the PrimaryKey 'OID' in the movie table.

I created a form to fill in an amount of shows. I also managed to get a LookUp from the corresponding coloum 'Movie' to a form, which gives me the option to fill in one of the existing movies.

BUT: After selecting the movie, I of course get the OID of the movie which is filled into the form and - presumeably - stored into the 'ShowTable'. It would be a lot nicer, if the operator would see the title of the movie in the form.

How can i get the title of the movie into the form, but the OID of the movie into the ShowTable?

Hope, someone will help.

greetz
- jens

Comments

  • DenSterDenSter Member Posts: 8,307
    Add a 'Movie Title' field to your Show table, and make it a flowfield. Then, in the CalcFormula set the method to lookup, the table to your Movie table, the field to the title field, and the table filter to MID=FIELD(OID) or something like that. Then, All you need to do is put the movie title on your form and Navision will take care of everything.

    The Movie Title field will actually never physically contain a value in the Show table, but it will show a value when the field is put on a form (or when you do a CALCFIELDS in C/AL Code).

    HTH
  • Jens_MurerJens_Murer Member Posts: 6
    Hi.

    Yes, we tried that one, but it doesn't work, don't ask me why, we REALLY tried to make this work.

    We now found some C/AL Code in Table 18 - Costumers, which reacts 'onValidate' and gets the Value, will try this next.

    - jens
  • DenSterDenSter Member Posts: 8,307
    Then you're not doing it right. If you set up your flowfield correctly (i.e. the relation to the other table), it shows the other field from the other table.
  • Jens_MurerJens_Murer Member Posts: 6
    Of course I'm not doing it right, but I can't find the mistake. We now put a little code on the onValidate - Trigger (Why aren't they called 'Events' like everywhere else?) and it works.

    Look out for my forthcoming questions on this board ;o)

    greets and thanks
    - jens
Sign In or Register to comment.