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
Post a Comment