Is there any cool grammar like this?

IoryIory Member Posts: 4
there are two tables like below:
TableA
field:a,b,c
data:1,2,3
2,4,5
3,1,1
3,1,2
...
TableB
field:a,d,e
data:1,1,5
1,2,2
2,1,4
2,2,5
...
TableA's primary key is field a,TableB's primary key is field a+d,TableA's field a is the same to TableB's field a;
I set two Rec: recTableA,recTableB

I want to get these records from tableB,they accord with the rules below:
1,field a in TableB is the same to TableA,after:recTableA.setfilter(b,'>=2');

How can I code it,with out "Repeat" ?
If there is any grammar like this:recTableB.setfilter(a IN recTableA.a);?


Comments

  • IoryIory Member Posts: 4
    "TableA's primary key" means "the primary key of TableA"!
  • flfl Member Posts: 184
    Unfortenately, Navision has no SQL syntax. So you can't use this in Navision.

    Your problem is in Navision impossible to solve without a "repeat"

    You need a loop or to go through every record to solve this problem.
    In a report you might add only one dataitem, being TableB. In the onaftergetrecord trigger, you could test to see if this value is present in TableA. If so place a boolean variable to true, else false. In the onpresection trigger of the dataitem body, you could add currreport.showoutput(<<the name of the boolean variable>>) to show or hide the required record.
    Francois
    Consultant-Developper

    http://www.CreaChain.com
  • IoryIory Member Posts: 4
    Thank you for your answer,I'll try your suggestion~
Sign In or Register to comment.