How to create a dynamic table relation

yekedeyekede Member Posts: 96
hi all,
i want to create a lookup for table A in table B using code in the lookup trigger of a field in table B.
ex: Form.runmodal(FormNo,RecordTableA) where FormNo is the lookupformid of table A. At design time i do not know which table is A, so i do not know the lookupformid of A. I can only get the tableA ID at run time. It is possible to create this type of tablerelation?
How can i achieve this?
Thanks

Comments

  • BeliasBelias Member Posts: 2,998
    if you do
    FORM.RUNMODAL(0,mytable);
    
    nav will run the lookupformid of mytable.
    but anyway...even if you use the above instruction, you'll need multiple variables for every possible table to be run, thus you'll need a case statement like this:
    CASE TableID OF
      1: FORM.RUNMODAL(0,mytable1);
      2: FORM.RUNMODAL(0,mytable2);
    END;
    
    morale: a "joker" table variable does not exist in NAV :(
    I hope I understood what you need...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.