How to set a certain financial dimension by code?
So in SalesTable header, i have mutiple finanical dimensions, where one of them i want to fill it based on salesLine
So this "flow" is empty in SalesTable, and I want to fill it by code based on the "Flow" value for one of the SalesLines that have the highest salesPrice
how can i do that?
So i was able to get the "Flow" value for the SalesLine with the highest SalesPrice... it's the DisplayValue from from dimensionAttributeValueSetItemView
but now how to set it for SalesTable??
SalesTable salesTable;
SalesLine salesLine;
DimensionAttribute dimensionAttribute;
DimensionAttributeValueSetItemView dimensionAttributeValueSetItemView;
select firstonly RecId from dimensionAttribute where dimensionAttribute.Name == 'Flow';
select firstonly DefaultDimension from salesLine
order by SalesPrice desc
where salesline.SalesId == 'XXXSO' ;
select firstonly DisplayValue from dimensionAttributeValueSetItemView
where dimensionAttributeValueSetItemView.DimensionAttributeValueSet == salesLine.DefaultDimension
&& dimensionAttributeValueSetItemView.DimensionAttribute == dimensionAttribute.RecId;
ttsbegin;
//select forupdate salesTable where salesTable.SalesId == 'XXXSO';
//salesTable.DefaultDimension = salesline.DefaultDimension
ttscommit;