See if
this will help you on your way.... Best regards
-Preston
Modify the lookup method on teh control to build the lookup form
Example:
public void lookup()
{
//This lookup basis the list criteria on information in 2 tables
//All display fields come from Table1, Table2 is used for limiting criteria
//super();
//This Next Line initializes the the sysTableLookupClass
sysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(<TABLENAME1>), this);
Query query = New Query();
QueryBuildDataSource qbdsTbl1, qbdsTbl2;
QueryBuildRange qbr;
;
//Add Tables to the data source
qbdsTbl1 = query.addDataSource(tableNum(<TABLENAME1>));
qbdsTbl2 = qbdsTbl1.addDataSource(tableNum(TABLENAME2));
//Add Query Ranges to limit List records
qbr = qbdsTbl1.addRange(fieldNum(<TABLENAME1>,<RANGEFIELDNAME1>));
qbr.value(<CRITERIAVALUE>);
qbr = qbdsTbl1.addRange(fieldNum(<TABLENAME1>, <RANGEFIELDNAME2>));
qbr.value(<CRITERIAVALUE>);
qbr = qbdsTbl1.addRange(fieldNum(<TABLENAME1>, <RANGEFIELDNAME3>));
qbr.value(<CRITERIAVALUE>);
//Since we have multiple tables in the query turn on relations
qbdsTbl1.relations(true);
//Add Ranges to the Table2
qbr = qbdsTbl2.addRange(fieldNum(<TABLENAME2>, <RANGEFIELDNAME4>));
qbr.value(<CRITERIAVALUE>);
qbdsTbl2.relations(true);
//The next 2 lines actualy adds the fields that will be displayed in the lookup grid
sysTableLookup.addLookupfield(fieldNum(<TABLENAME1>, <DISPLAYFIELDNAME>));
sysTableLookup.addLookupfield(fieldNum(<TABLENAME1>, <DISPLAYFIELDNAME>));
//Hand the created query to the sysTableLookupClass
sysTableLookup.parmQuery(query);
//Display the drop down
sysTableLookup.performFormLookup();
}
-----Original Message-----
From: Mikael Dalg�rd [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 3:13 AM
To: [EMAIL PROTECTED]
Subject: [development-axapta] Field lookupHi allCan anybody help me with this?I have a form with two fields Grid_QAS_PurchID and Grid_QAS_ItemId. The Grid_QAS_PurchId is related to the PurchTable and the Grid_QAS_ItemId is related to the PurchLine.My question is how to make a filter/ lookup methods that gives the possibilities for users to enter a Puch ID number in the form, and then only get the related purch lines in the Grid_QAS_ItemId field string edit. In some kind of a combo box. As it is now the users gets all of the purch lines when they drop down.best regardsMikael Dalg�rd
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

