Pages

Banner 468 x 60px

 

Wednesday, November 22, 2017

GetInventoryDimensions using x++

0 comments
GetInventoryDimensions using x++ :

static void _GetInventoryDimensions(Args _args)
{
    InventTable                 inventTable = inventTable::find('D0004');
    InventItemOrderSetupType    setupType   = InventItemOrderSetupType::Invent;
    InventDim                   inventDim;
    ;

    // Default Site
    inventDim.InventSiteId = inventTable.inventItemOrderSetupMap(setupType).inventSiteId(inventDim.InventSiteId, inventTable);

    // Default Location
    inventDim.InventLocationId  = inventTable.inventItemOrderSetupMap(setupType,
                                                                      InventDim::findOrCreate(inventDim).InventDimId)
                                                                      .inventLocationId(inventDim.InventLocationId,
                                                                                        inventTable,
                                                                                        inventDim.InventSiteId);

    // Default ConfigId
    inventDim.ConfigId = inventTable.StandardConfigId;

    // Find Default Item Dimension
    inventDim = InventDim::findOrCreate(inventDim);

    info(strFmt('Invent Dim. Id: %1', inventDim.inventDimId));
    info(strFmt('Site Id: %1', inventDim.InventSiteId));
    info(strFmt('Warehouse Id: %1', inventDim.InventLocationId));
}

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