To find the setting of a known attribute, feed the following (In this case, the inventJournalTrans table).
// _journalId = unique journal Id
// _attrToFind = the name of the attribute you are looking for
InventJournalTrans inventJournalTrans;
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttr;
DimensionFinancialTag dimFinTag;
str 60 attrToFind;
str 10 journalid;
str 30 findValue;
;
select inventJournalTrans
where inventJournalTrans.JournalId == _journalId
join dimAttrValueSet where InventJournalTrans.defaultDimension == dimAttrValueSet.recId
join dimAttrValueSetItem where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
join dimAttrValue where dimAttrValue.RecId == dimAttrValueSetItem.DimensionAttributeValue
join dimAttr where dimAttr.RecId == dimAttrValue.DimensionAttribute
&& dimAttr.Name == _attrToFind;
And to get the description of the attribute;
_findValue = dimAttrValue.getValue();
select firstOnly dimFinTag where dimFinTag.Value == _findValue;
No comments:
Post a Comment