Hi All,

 

            I asked some information about look up operations before. Fist of all, Thank you for your helps.

            Besides, I want to ask a question about look up operations. So, I wanted to limit look up screen for a coloumn related with two coloumns on the same grid table. I asked this question before. And I learned. Now, my look up screen has a coloumn (for example; that’s name is InventColorId (from InventDimCombination table on the database)) and its working is true. But also, I want to add a coloumn (for example; that’s name is Name from InventColor table on the same database) at the same time. I suppose that I must write a query which supplies relations (or join) between these two tables (for example; InventDimCombination.InventColorId == InventColor.InventColorId).

 

            In addition to above; my look up code is now :

 

public void lookup()

{

     sysTableLookup          sysTableLookup  = SysTableLookup::newParameters(tableNum(INVENTDIMCOMBINATION), this);

 

     Query                            query           = New Query();

     QueryBuildDataSource    qbdsTbl1;

     QueryBuildRange            qbr;

     ;

 

     //Add Tables to the data source

     qbdsTbl1      = query.addDataSource(tableNum(INVENTDIMCOMBINATION));

 

     //Add Query Ranges to limit List records

     qbr = qbdsTbl1.addRange(fieldNum(INVENTDIMCOMBINATION, ITEMID));

     qbr.value(SalesLine.ItemId);

 

     if ((InventDim.configId == "") || (InventDim.InventSizeId == ""))

     {

        // This section is used, if user don’t select another two coloumn (those are required) together on the same grid.

        qbr = qbdsTbl1.addRange(fieldNum(INVENTDIMCOMBINATION, CONFIGID));

        qbr.value(".");

 

        qbr = qbdsTbl1.addRange(fieldNum(INVENTDIMCOMBINATION, INVENTSIZEID));

        qbr.value(".");

     }

     else

     {

        qbr = qbdsTbl1.addRange(fieldNum(INVENTDIMCOMBINATION, CONFIGID));

        qbr.value(InventDim.configId);

 

        qbr = qbdsTbl1.addRange(fieldNum(INVENTDIMCOMBINATION, INVENTSIZEID));

        qbr.value(InventDim.InventSizeId);

 

     }

        //The next line actualy adds the fields that will be displayed in the lookup grid

        sysTableLookup.addLookupfield(fieldNum(INVENTDIMCOMBINATION, INVENTCOLORID));

 

        //Hand the created query to the sysTableLookupClass

        sysTableLookup.parmQuery(query);

 

        //Display the drop down

        sysTableLookup.performFormLookup();

}

 

            Consequently, You think, what must I do for this operations.

 

            Thank you.

 

            MJ.

 


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to