lookup value of other tbl where condition is in different tb

makaramakara Member Posts: 25
edited 2014-07-07 in NAV Three Tier
Dear everyone,

I have a problem in looking up value from other table where my look up condition value was stored in another table. Sound confusing, right? please see below for a better understanding :

I am on table "Sales & Receivable Setup", my customize field need to add TableRelation property like below :
Look up to "Dimension Value".Code
Where "Dimension Value"."Dimension Code"="General Ledger Setup"."Global Dimension 1 Code"

Please give me some advice on this problem.
Thanks in advance,
Makara

Answers

  • krikikriki Member, Moderator Posts: 9,110
    Just go to TableRelation, click the assistbutton, and in TableRelation you can put the filter.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • KishormKishorm Member Posts: 921
    makara wrote:
    I am on table "Sales & Receivable Setup", my customize field need to add TableRelation property like below :
    Look up to "Dimension Value".Code
    Where "Dimension Value"."Dimension Code"="General Ledger Setup"."Global Dimension 1 Code"

    It's not possible to do this in general (a table relation filter based on value in a third table) using the TableRelation property, instead you would need to achieve this via code in the OnLookup trigger (to allow the user to lookup valid values) and also add code to the OnValidate trigger (to check for valid values if the user types in a value).

    However, having said the above, there is an alternative to achieving what you want for your specific scenario above (I.e. a lookup to Global Dimension 1 Values) by entering the following in the TableRelation property...

    "Dimension Value".code WHERE (Global Dimension No.=CONST(1))
  • makaramakara Member Posts: 25
    Thx Kishorm and kriki,

    I got ideas from you, guys. Now I create another page. when user click on "Assist button", I call my page and set filtered table variable to that page. it works as expected.
Sign In or Register to comment.