How to write Code for financial dimension mandatory.
[ExtensionOf(classStr(ProjJournalCheckPost))]
internal final class DAXJournal_Extension
{
protected void postJournal(JournalTransList _journalTransList)
{
DimensionAttribute dimAttr;
DimensionAttributeValue dimAttrValue;
DimensionAttributeValueSetItem dimAttrValueSetItem;
ProjJournalTrans ProjJournalTrans;
RefRecId defaultDimension;
JournalTransMap journalTransMap;
boolean ret;
next postJournal(_journalTransList);
journalTransMap = _journalTransList.item();
projJournalTrans = journalTransMap;
dimAttr = DimensionAttribute::findByName('Department');
select firstonly RecId, DisplayValue from dimAttrValueSetItem
where dimAttrValueSetItem.DimensionAttributeValueSet == ProjJournalTrans.DefaultDimension
join dimAttrValue
where dimAttrValue.RecId == dimAttrValueSetItem.DimensionAttributeValue
&& dimAttrValue.DimensionAttribute == dimAttr.RecId
&& dimAttrValue.IsDeleted == false;
if (!dimAttrValueSetItem.DisplayValue)
{
Warning("Department must be specified.");
}
}
}
No comments:
Post a Comment