Occassionally you may need a code snippet to create invent dim if it didn't exist for the inventory transactions for the new combination. Just sharing to keep it as a knowledge base.
static void CreateInventDim(Args _args) //Create a new invent Dim
{
InventDim inventDim,inventDimFind;
//Batch = 123459
inventDim.clear();
inventDim.inventLocationId = 'HOUSTON';
inventDim.InventSiteId = 'CENTRAL';
//inventDim.inventBatchId = “123459
inventDimFind = inventDim::findOrCreate(InventDim);
info(inventDimFind.inventDimId);
}
static void CreateInventDim(Args _args) //Create a new invent Dim
{
InventDim inventDim,inventDimFind;
//Batch = 123459
inventDim.clear();
inventDim.inventLocationId = 'HOUSTON';
inventDim.InventSiteId = 'CENTRAL';
//inventDim.inventBatchId = “123459
inventDimFind = inventDim::findOrCreate(InventDim);
info(inventDimFind.inventDimId);
}