X++ in RDP class

i am written code rdp class but iam getting all data but i want to data between fromdate and todate

Parents
  • Query  query;

    Query run qr;

    Inventory contract contract;

    Contract = this. Parmdatacontract() ;

    Form date = contract . Parmformdate() ;

    ToDate = contract. Parmtodate() ;

    qr=new Querrun(this. Parm query) ;

    While(qr. Next())

    {

    Invent table = qr. Get (tablenum(Invent table) ) ;

    Inventitemgroupitem = qr. Get(tablenum(Inventitemgroupitem) ) ;

    {

    select inventTrans
    where inventTrans.StatusReceipt == StatusReceipt::Purchased
    && inventTrans.DatePhysical >= fromDate
    && inventTrans.DatePhysical <= toDate
    join inventTransOrigin
    where inventTransOrigin.RecId == inventTrans.InventTransOrigin
    && inventTransOrigin.ReferenceCategory == InventTransType::Purch;

    {

    //.... Inserting recrods

    }

    }

     

  • select inventTrans
    where inventTrans.StatusReceipt == StatusReceipt::Purchased
    && inventTrans.DatePhysical >= fromDate
    && inventTrans.DatePhysical <= toDate
    join inventTransOrigin
    where inventTransOrigin.RecId == inventTrans.InventTransOrigin
    && inventTransOrigin.ReferenceCategory == InventTransType::Purch;

    You are not considering the ItemId in your select, so it may return the same data for every item. Include the below line,

    inventTrans.ItemId == inventTable.ItemId

Reply Children
No Data
Related
Recommended