Saturday, September 7, 2013

Item의 Default Order Settings 일괄 생성

아래 Job을 통해서 Default Order Settings(Inventory, Purchase Order, Sales Order)를 생성 시킬 수 있습니다.

static void Set_DefaultOrderSettings(Args _args)
{
    InventTable inventTable;
    InventItemInventSetup invent;
    InventItemPurchSetup purch;
    InventItemSalesSetup sales;
    ;
    delete_from invent;
    delete_from purch;
    delete_from sales;
    while select inventTable
    {
        if(!InventItemPurchSetup::findDefault(inventTable.ItemId))
        {
            InventItemPurchSetup::insertDefault(inventTable.ItemId);
        }
        if(!InventItemInventSetup::findDefault(inventTable.ItemId))
        {
            InventItemInventSetup::insertDefault(inventTable.ItemId);
        }
        if(!InventItemSalesSetup::findDefault(inventTable.ItemId))
        {
            InventItemSalesSetup::insertDefault(inventTable.ItemId);
        }
    }
}

No comments: