Options

How to create simple lookup fields

selece28selece28 Member Posts: 316
Hi all,
I currently want to create 3 lookup fields from one table in a Form.
This is the scenario
I create a new table consist of 3 fields, let say Field A, B, and C.

I want to add this 3 fields in Sales Quotation Form
and it can do lookup like [Sell-to City] or [Sell-to Post Code] field
So I add 3 new fields in Sales Header table, Field A,B, and C

I see that NAV use a Code Unit(with lots of codes) to do this, its so complicated, Is there any easier way? :-k

Thanks in advance.
______________

Regards,
Steven

Answers

  • lubostlubost Member Posts: 633
    The simplest scenario to create lookup is following:
    1. Add field to table (Sales Header in your example)
    2. Set up Table relation of this field (in properties) to table you want
    3. There must me set up the LookupFormID (in table properties) in related table.

    If any of these steps can't be done, you have to input a code snippet to OnLookup trigger of new field (on table or on form, but table is much better).
  • selece28selece28 Member Posts: 316
    Yes this can be done, but it still wont refresh the other fields
    If i change A, the B and C wont change, or If i change B the A and C wont change. How to do this?
    I can only think of doing it by writing a CAL codes, Or can we do it from properties?

    Thanks
    ______________

    Regards,
    Steven
  • lubostlubost Member Posts: 633
    It can be done only by code in OnValidate trigger.
  • selece28selece28 Member Posts: 316
    Ow if that the case
    Thank You lubost

    I'll do all by C/AL Codes then :wink:
    ______________

    Regards,
    Steven
Sign In or Register to comment.