Here are some notes I made for myself on doing this, you will override the lookup method on the control, you also may have to set the lookupButton property on the field. 

 

G’luck.  -Preston

 

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: Michael JACKSON [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 5:38 AM
To: [EMAIL PROTECTED]
Subject: [development-axapta]

 

Hi All,

 

            I want to control look up operation for a coloumn on a grid table on the form. So, I want to limit data in the look up screen for coloumn related with two coloumn on same grid table. What must I do for this operation. Tell me please.

 

            Thank you.

 


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.




Yahoo! Groups Links

Reply via email to