Friday, February 9, 2018

AX - "UPDATE" job

"Update job" - it change flushing princip on group of items to "Finish".
static void SetFlushingPrincipItem(Args _args)
{
    InventTable inventTable;
    
    ttsBegin;

    while
    select forUpdate * from inventtable
    where
    inventTable.ItemId like "S-*" &&
    inventTable.ProdFlushingPrincip != ProdFlushingPrincipItem::Finish
    {      
        inventTable.ProdFlushingPrincip = ProdFlushingPrincipItem::Finish;          
        inventTable.update();
        
        info( InventTable.ItemId );     
    }

    ttsCommit;

    info( 'OK' );    
}

No comments:

Post a Comment