How to get default financial dimension (channel) value from the sales header?

Hi Master,

I have a question,

I have trade agreement with field channel. when item selected from salesline price will read by default dimension (channel) selected from salestable. I try create method in class PriceDisc with parameter channel, I put in method in findPriceAgreement.

I want put default dimension (channel) on my method, but I don’t know. how I get default dimension (channel) from salestable.?

please advice me, thanks

See the below code example.

DimensionAttribute dimensionAttribute = DimensionAttribute::findByName(‘Channel’);
DimensionAttributeValueSetItemView dimensionAttributeValueSetItemView;

select firstonly DisplayValue from dimensionAttributeValueSetItemView
where dimensionAttributeValueSetItemView.DimensionAttributeValueSet == SalesTable.DefaultDimension
&& dimensionAttributeValueSetItemView.DimensionAttribute == dimensionAttribute.RecId;