This is because you create new query.. It will not work. do not create new query.. First take the query from the system and then add a range.. And try to do that not in the init method of the form, in the init method of the datasource.
 
Best regards.
 
 
  
   Mehmet Özgür Genç

   Team Leader, Lead Developer
  
   Tel : +90 212 283 91 23 / 2042
   Mobile: +90 533 225 93 05 
   http://www.veripark.com


Kimden: Axapta-Knowledge-Village@yahoogroups.com bu kişinin yerine: Cenk Ince
Gönderilmiş: Per 07.07.2005 13:58
Kime: Axapta-Knowledge-Village@yahoogroups.com
Konu: BomPartOF i can't add range with code

Hi all;

On BomPartOf form i open form Query and and on datasource Bom i rigth clicked and select N:1 then select bomversion table. When i add range as active on bomversion i only see boms that has active bomversion.

But when i add code below i can't have the same result why?

Thanks.

 

void init()
{
    Query                   q;
    QueryBuildDataSource    qB;
    QueryBuildDataSource qds;
    QueryBuildRange qbr;

    super();

    q                   = new Query();
    qB                  = q.addDataSource(tablenum(BOM));
    criteriaBOMItemId   = qB.addRange(fieldnum(BOM,itemId));
    criteriaBOMFromDate = qB.addRange(fieldnum(BOM,fromDate));
    criteriaBOMToDate1  = qB.addRange(fieldnum(BOM,toDate));
    criteriaBOMToDate2  = qB.addRange(fieldnum(BOM,toDate));

    qds = qb.addDataSource(tablenum(BomVersion));
    qds.addRange(fieldnum(BomVersion,active)).value(enum2str(Noyes::Yes));
    qds.joinMode(JoinMode::ExistsJoin);
    qds.relations(true);

    BOM_ds.query(q);
}



Sharing the knowledge on Axapta.



YAHOO! GROUPS LINKS




Reply via email to