Recently I came across a situation where I needed to validate if the inventory dimension "PalletId" is active on an item or not. After a little digging here and there, came across this piece of standard AX code to identify if an inventory dimension is active or not. It is always good to re-use standard AX code instead of writing our own logic. This helps in maintaining the quality of the code.
inventTable = InventTable::find('1000');
inventDimParm = InventDimParm::activeDimFlag(
Similarly we can validate other inventory dimensions as well.