Hi,

i hope the following code will give u the result what
u expect.

client static void lookupToolCode(FormStringControl
lookupCtrl)
{
    SysTableLookup          sysTableLookup =
SysTableLookup::newParameters(tableNum(ProjTable),
lookupCtrl);
    Query                   query = new Query();
    QueryBuildDataSource    queryBuildDataSource =
query.addDataSource(tableNum(ProjTable));
    QueryBuildRange         ParentId,Serial;

    ParentId =
queryBuildDataSource.addRange(fieldNum(ProjTable,ParentId));
    Serial =
queryBuildDataSource.addRange(fieldId2Ext(fieldnum(ProjTable,
sortingId),1));
    Serial.value('PLANT');

    sysTableLookup.addLookupField(fieldNum(ProjTable,
ProjId));

    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();

}

u have to call the above method from ur form control
like this:
public void lookup()
{
    //super();
    ;
    ProjTable::lookupToolCode(this);
}


regs,
Hema. S

--- Padmaja Iyingar <[EMAIL PROTECTED]> wrote:

> Hi,
>   
>   Here is the lookup I using.
>   
>   public void lookup()
> {
>       Query                   query          = new
> Query();
>     QueryBuildDataSource    queryBuildDataSource;
>     QueryBuildRange         queryBuildRange  ;
>       SysTableLookup          sysTableLookup =
> SysTableLookup::newParameters(tableNum(ProjTable),
> this);
>     str rangeStr;
>       ;
>  
>   
> sysTableLookup.addLookupField(fieldNum(ProjTable,
> ProjId));
>       queryBuildDataSource =
> query.addDataSource(tableNum(ProjTable));
>       queryBuildRange =
> queryBuildDataSource.addRange(fieldNum(ProjTable,
> RecId))  ;
>     
> //queryBuildDataSource.addRange(fieldNum(ProjTable,
> parentId)).value('');
>    
>   
>
//queryBuildDataSource.range(2).addRange(fieldId2Ext(fieldnum(ProjTable,
> sortingId),1)).value('PLANT');
>     
>   
>    rangeStr = strfmt("'((%1 == %3))' + '&& (%2 ==
> %4))'", fieldId2Ext(fieldnum(ProjTable,
> sortingId),1),fieldNum(ProjTable,ParentID),
> 'PLANT',"");
>   
>       queryBuildRange.value(rangeStr);
>  
>     sysTableLookup.parmQuery(query);
>       sysTableLookup.performFormLookup();
> }
>   
>   
>   I want to build the query with AND Range...
>   
>   Equivalent select statement..
>   
>   While select projTable where ProjTable.ParentID ==
> '" and projTable.sortindID[1] == 'PLANT'
>   
>   what is the quivalent in addrange...
>   
>   
>   The reocrds are no getting filtered and I get all
> the reocrds...How can I achive this..on the Table
> level. My form has no data source....
>   
>   
>   I am not able to do AND in AddRange firleds..
>   
>   please help help help
>   
>   
>   Padmaja,
>   
>
>            
> ---------------------------------
> Bring words and photos together (easily) with
>  PhotoMail  - it's free and works with Yahoo! Mail.
>
> [Non-text portions of this message have been
> removed]
>
>
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to