Lookup (using table relation) Returns A Wrong Value.

superpuzsuperpuz Member Posts: 53
edited 2013-04-29 in NAV Three Tier
Hi All,

In NAV 2013, I was trying to create a field that look-ups City from Post Code Table. So I set the TableRelation property on the field (the name of the field is City Name) to "Post Code".City. In My Post Code Table there are Post Codes such bellow:
ID-10310 Jakarta Utara
ID-10440 Jakarta
ID-11470 Jakarta Barat
And there are also many other Post Codes on the table.

When I ran the table (on Windows Client), I have options on how to enter a value to City Name Field.
1. Type the city name directly to field,
2. Select from the drop-down list on the field
3. Type first part of the city name (exp. "jak") so the drop-down list shows all the Post Code, which its city is preceded with "jak", and select from the drop-down list
4. Open the drop-down list by pressing the down arrow on right corner of the field, click advance, filter to search the City that I wanted then press OK.

The problem when using those 4 methods:
1. When I type "Jakarta" and move to other field / record, the value will be set to "Jakarta Utara" instead of "Jakarta"
2. On the drop-down list, I select post code ID-10440, Jakarta, then the value of the field is changed to "Jakarta", but when I move to other field / record, the value will be set to "Jakarta Utara" instead of "Jakarta"
3. Same with method no. 2.
4. Same with method no. 2.

It seems that the table relation caused the field is set to the City on the first Post Code (sort by primary key) which is preceded with the word(s) which user has entered by typing or choosing from the drop-down list or advance look-up window.

Is this a bug?

Regards,

Philipus
Regards and Thanks,


Superpuz

Comments

  • superpuzsuperpuz Member Posts: 53
    I have worked around this by adding a code in onLookup trigger using page.runmodal and Action::LookupOK, but the behaviour is not the same with using table relation to lookup.

    Is anyone has an explanation / a thought to work around this without killing any TableRelation functionality such as dropdown list which shows options or selection based on the words that user typed.
    Regards and Thanks,


    Superpuz
  • superpuzsuperpuz Member Posts: 53
    Does anyone know why?

    To lookup by TableRelation to a table with more than 2 fields on its primary key, and not the 1st field of primary key which the value return form the lookup, the lookup could return an invalid value?

    Regards,
    Philipus
    Regards and Thanks,


    Superpuz
Sign In or Register to comment.