How can I Filter a dataset with fields from 2 tables.

Hello,
I am a newbie on NAV. Would like to ask for your expertise.
Created a form with a TableBox control. also set a table name "A" as its 'SourceTable' properties, in the TableBox I also add 2 fields " B1,B2" which from Table "B", It's OK,but user want to filter the data with B1.B2, Now question is: I can get the filter string from user by a "Dialog" windows , but how can I filter the data? Becuase the variable 'REC' is subjec to table A, it has no the B1,B2 fields.
Thank you.

Answers

  • vaprogvaprog Member Posts: 1,144
    The easiest way to solve this is to define B1 and B2 as FlowFields in Table A.

    Other options (messy, slow, expensive):
    • Set the filters for B1, B2 in a worksheet style (e.g. like sales price); You need then to modify OnFind and OnNext triggers on the page in order to do the filtering
    • create a table as a copy of table a, but include fields B1, B2. use this table as a temporary sourcerecord on the page and fill it with records not regarding filters on B1, B2; Make sure changes to the temporary table are propagated to real table A, and temporary Rec is not used anywhere where real Table A is expected.
  • bindcnbindcn Member Posts: 3
    vaprog wrote: »
    The easiest way to solve this is to define B1 and B2 as FlowFields in Table A.

    Other options (messy, slow, expensive):
    • Set the filters for B1, B2 in a worksheet style (e.g. like sales price); You need then to modify OnFind and OnNext triggers on the page in order to do the filtering
    • create a table as a copy of table a, but include fields B1, B2. use this table as a temporary sourcerecord on the page and fill it with records not regarding filters on B1, B2; Make sure changes to the temporary table are propagated to real table A, and temporary Rec is not used anywhere where real Table A is expected.

    Many thanks.
Sign In or Register to comment.