Recep
November 6, 2015, 10:00am
1
Hi,
i want to get more than one field value with lookup method in ax 2009 with code… Example;
i have a table. Table1. table1 include 5 fields. field1,field2,field3,field4,field5.
i can get only field1 with classic lookup method… but i need field1 value and field2 value…
thanks.
ThomasP
November 6, 2015, 10:08am
2
Hi,
I assume you’re using SysTableLookup class to perform specific lookup, you just have to add the following code to add fields in your lookup:
sysTableLookup.addLookupfield(fieldNum(yourTable,YourField1));
sysTableLookup.addLookupfield(fieldNum(yourTable,YourField2)); etc…
Hope it helps, please verify solution if it solves your problem
regards,
Thomas
kranthi
November 6, 2015, 10:12am
3
How you are building the lookup?
Recep
November 6, 2015, 10:18am
4
Thanks Thomas… but i think i couldnt my problems…
my code this.
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(Table1), this);
;
sysTableLookup.addLookupfield(fieldNum(Table1, field1));
sysTableLookup.addLookupfield(fieldNum(Table1, field2));
sysTableLookup.addLookupfield(fieldNum(Table1, field3));
sysTableLookup.addLookupfield(fieldNum(Table1, field4));
sysTableLookup.addLookupfield(fieldNum(Table1, field5));
i can get value of field1 when select lookup. But i want to get value of field1 and field2…
How to make this…?
ThomasP
November 6, 2015, 10:29am
5
try the following: after your first line with sysTableLookup, my example uses CommissionSalesGroup Table
Query query = New Query();
QueryBuildDataSource QueryBuildDataSource;
QueryBuildRange QueryBuildRange;
;
QueryBuildDataSource = query.addDataSource(tableNum(CommissionSalesGroup));
QueryBuildRange = QueryBuildDataSource.addRange(fieldNum(CommissionSalesGroup,name));
sysTableLookup.addLookupfield(fieldNum(CommissionSalesGroup,name));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
kranthi
November 6, 2015, 10:38am
6
Your explanation of the problem is not clear. Can you please elaborate what is your problem or what is your requirement?
When you post the code, try to post the total code.
Recep
November 6, 2015, 11:33am
7
Hello again,
EDT to customize the combobox was created with. Customization code below. In many places, if I want to display which fields of the table in this way use flags that pertain to. In this way after making the selection, customization and only can the value of a field in a table (Table1. of field1).But after the election problem here 2 field value order (table1. of field1 and field2 table1.).
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(Table1), this);
;
sysTableLookup.addLookupfield(fieldNum(Table1, field1));
sysTableLookup.addLookupfield(fieldNum(Table1, field2));
sysTableLookup.addLookupfield(fieldNum(Table1, field3));
sysTableLookup.addLookupfield(fieldNum(Table1, field4));
sysTableLookup.addLookupfield(fieldNum(Table1, field5));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
ThomasP
November 6, 2015, 11:44am
8
EDT lookup usually uses field contained in autoreport fieldgroup (see your table properties), if you add fields in autoreport field group they should appear in your lookup without adding lookup method on your field. My code can be used as custom lookup for field that does not have EDT
Recep
November 6, 2015, 11:47am
9
Yes Thomas this code not EDT. but i can use selected row field1.
But i want to use filed1 value and field2 value when selected row with combobox… by the way my english is not good… sorry…
Recep
November 6, 2015, 12:03pm
10
Hello again,
first as seen in the image options “Madde Kodu” field is equipped with two U054 0002 00. One of the other “Konfigürasyon” 00 other 01. After making the selection, as shown in the second image only “Madde Kodu” field information. Sets the “Konfigürasyon” area of the 00 or 01 is not known. For this reason, the choice and I want to know the value of two fields at the time. How can we do this process.
picture 1
picture 2
kranthi
November 6, 2015, 12:17pm
11
It will show only the selected field value. Konfigürasyon is a different field.
Would it be possible for you to add Konfigürasyon field in the grid and populate it after the selecting/modifying the Madde Kodu value?
Recep
November 6, 2015, 12:25pm
12
Thanks Kranthi.
If I understand it correctly, you’re saying the selection was done twice. first select “Madde Kodu” ,then “Konfigürasyon” area should be selected?
kranthi
November 6, 2015, 12:32pm
13
The selection of Konfigürasyon need not be manual.From the Madde Kodu value , you need to find the related Konfigürasyon value and update that field.
I am saying to add two fields to the grid, upon selection of one you can updated the other field value.
kranthi
November 6, 2015, 12:41pm
15
which part you didn’t understand?
Recep
November 6, 2015, 12:44pm
16
How to find the Konfigürasyon value after selection??
kranthi
November 6, 2015, 12:54pm
17
there should be some relation between them right? (you can write a select statement to find the value)
Recep
November 6, 2015, 1:01pm
18
but there is two row for “madde kodu” field… ??
Select * from table1 where table1.MaddeKodu == this.text();
result 2 rows??
It is not known which one is selected again.
Recep
November 6, 2015, 2:15pm
19
i solved with recid… Later Select statement…
Thanks everybody…