probem with lookup

hi,

i need to have a look up field for a string edit control… the lookup value must be fetched from three table…(TB1,TB2,TB3)

first i should compare TB1 and TB2 and select some records(by using inner join)…

the result of above should be compared with TB3 and then the values should be shown in lookup…

can anyone pls help me…

How should it “be compared with TB3”? Can you give us an example? And what’s your version of AX?

am using ax 2012…

TB1 → field1(enum),recid

TB2->field2(int64),recid

TB3->field3(int64)

the condition is if enum of table1==yes, then fetch the corresponding RecId and compare the RecId(TB1) with field2(TB2)

now fetch matching RecId of table 2 and compare it with field3(Int64)

Hi,

Override lookup method of field in data source level and instantiate the systablelookup class to add 3 tables by query, qbds1,qbds2,qbds3(see any example to add data source) and specify the fields which you need to show lookup then specify the condition like below

while select tb1 where tb1.enaum==… join tb2 where tb1.field== tb2.field join tb3 where tb2.field == tb3.field

now give the final range by using querybuildrange.value(query value(tb3.field)) it’s based on requirement

Then systablelookup.parmquery(query);

systablelookup.performlookup();

Regards,

Nagaraj

Am checking conditions for 1.tb1 and tb2 2.tb1 and tb3

if i use the above code i can only join tb1 and tb2, tb2 and tb3.

How to achieve my requirement through join in ax.