How to check a particular dimension is filled or not?


Hi,
Use the below code to check whether a dimension is filled or not in the default dimension.

   public Boolean checkDeptartmentDimension(){ 
DimensionAttributeValueSetItem dimAttrValueSetItem;

DimensionAttribute dimAttr;

DimensionAttributeValue dimAttrValue;

Common dimensionValueEntity;
 
dimAttr = DimensionAttribute::findByLocalizedName('Department');

select dimAttrValueSetItem

where dimAttrValueSetItem.DimensionAttributeValueSet == this.DefaultDimension

join dimAttrValue

where dimAttrValue.RecId == dimAttrValueSetItem.DimensionAttributeValue

&& dimAttrValue.DimensionAttribute == dimAttr.RecId;
 
if (!dimAttrValueSetItem)

     return checkFailed(strFmt("Department dimension must be filled in."));

return true;

} 

Comments

Popular posts from this blog

x++ code to Generate cheque for vendor payment journal

Import Procurement Hierarchy / Categories with out code in ax 2012

Copy favorites From one user to another user - Ax 2012