Monday, February 22, 2021

How to De block the Item from Invent Block in D365fo

 Hi guys, Today we see How to De block  the Item from Invent Block in D365fo.


Check below job.

static void deBlock(Args _args)

{

 InventBlocking   inventBlocking ;

    InventDim       inventDim;


    inventDim.InventSiteId='1';

    inventDim.InventLocationId='11';

    inventDim = InventDim::findOrCreate(inventDim);

    

    select inventBlocking join inventDim

        where inventBlocking.ItemId=="Dax Sub 1"

        &&inventBlocking.InventDimId==inventDim.inventDimId

        && inventBlocking.Qty==3;


    ttsBegin;

    if (inventBlocking.BlockingType == InventBlockingType::Manual)

    {

        inventBlocking.selectForUpdate(true);

        inventBlocking.delete();

        info(strFmt('%1','del'));

    }

    ttsCommit;

}

Keep Daxing!!

No comments:

Post a Comment