Hello Hilda,

try this code, place it in the lookup-method of the formcontrol or
of the field of the datasource:

SysTableLookup          stlu;
Query                   query;
QueryBuildDataSource    qbds;
QueryBuildRange         qbr;

;

query = new Query();      // Create a Query
qbds = query.addDataSource(tablenum(<TableName>));      // Add this Table in the
Query
qbr = qbds.addRange(fieldnum(<TableName>,<FieldName>)); // Add this Field as
Range

qbr.value(">1000");      // set the QueryValue as string

// Create a Lookup-Object
// _formControl1 is lookup at formcontrol:this, lookup at field:
_formcontrol as parameter in the method-header
stlu = SysTableLookup::newParameters(tablenum(<TableName>), _formControl1 );
// which Fields to show in the lookup
stlu.addLookupfield(fieldnum(<TableName>,<FieldName>),true);            // ,true
means: this is the lookup-Value
stlu.addLookupfield(fieldnum(<TableName>,<FieldName>));
stlu.parmQuery(query);            // the Lookup-Object has to use this query

stlu.performFormLookup();      // do the Lookup


it's also at:

http://www.source-center.de/forum/showthread.php?p=7166

best regards,

SebDra

-----Original Message-----
From: hilda cabrejos [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 11, 2004 10:13 PM
To: [EMAIL PROTECTED]
Subject: [development-axapta] Lookup method, how can I do a different
lookup using another table





Hello every body I need help to do the following:



I have a table called TBSCustMerchandise: CustAccount, MerchandiseId this
table has the merchandise that a client transports.   In the
SmmQuotationTable (form) I have a Tab where we enter the merchandise that
our company is going to transport for a given client.  What we want is to
show only the merchandise of the client and not all the possible
merchandise.  I know that I have to change the lookup method for the field
where I am going to enter the MerchandiseId so it will only show the clients
merchandise, do some kind of inner join.



Can anybody tell me how to do it ?



Thank you in advance



Hilda



---------------------------------
Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com

[Non-text portions of this message have been removed]








Yahoo! Groups Links











Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to