Pages

Banner 468 x 60px

 

Saturday, June 4, 2022

Get Invent Site from WareHouse and Item by Code X++

0 comments

static void OnHandOnDate(Args _args)

{

    ItemId                      itemId;

    InventDim                   inventDimCriteria;

    InventDimParm               inventDimParm;

    InventSumDatePhysicalDim    inventSumDateDim;

    InventTable                 InventTable;

    InventLocation              Inventlocation;

    ABUSnapshot                 ABUSnapshot;

    InventSiteId                inventSiteId;

    transDate                   Dated;

    ;


    while select * from 

        InventTable 

            order by itemid

            where InventTable.itemid like 'P*'

            //where InventTable.itemid == "P000005"

    {

        

        Dated = systemDateGet();

        

        while select * from 

            Inventlocation 

                order by inventlocationid

                //where Inventlocation.InventLocationId == "CNK"

                where Inventlocation.WMSLocationIdDefaultReceipt == 'Staging'

        {

            itemId                              = InventTable.ItemId;

            inventDimCriteria.InventLocationId  = Inventlocation.InventLocationId;

            inventDimCriteria.InventStatusId    = "AVAILABLE";

    

            inventDimParm.initFromInventDim(inventDimCriteria);

            //inventSumDateDim = InventSumDatePhysicalDim::newParameters(mkdate(03,06,2022), itemId, inventDimCriteria, inventDimParm);

            // Dated

            inventSumDateDim = InventSumDatePhysicalDim::newParameters(Dated, itemId, inventDimCriteria, inventDimParm);

            info(strfmt("itemid : %1 Phs: %2 Whs : %3",itemId, inventSumDateDim.physicalQuantity(), Inventlocation.InventLocationId));

            

            ttsbegin;

            ABUSnapshot.ItemId          = itemId;

            ABUSnapshot.ProductName     = EcoResProduct::find(InventTable.Product).productName();

            ABUSnapshot.WHS             = Inventlocation.InventLocationId;

            ABUSnapshot.Site            = InventLocation::find(Inventlocation.InventLocationId).InventSite().SiteId;

            ABUSnapshot.Date            = Dated;

            ABUSnapshot.DataAreaName    = curext();

            ABUSnapshot.Qty             = inventSumDateDim.physicalQuantity();

            ABUSnapshot.insert();

            

            ttsCommit;

        }

    }


}

0 comments:

A financial dimension value is based on the record and has been used on a transaction. You cannot delete the record

  SOLUTION delete in table DimensionAttributeLevelValue base on Bank Account  :  and Delete the Bank Account FINISH