Add Display method to DataSoruce to get Discount Percent1 From PriceDiscTable

[SysClientCacheDataMethodAttribute(true)]

display DiscPct displayDiscount(PriceDiscTable _PriceDiscTable)
{
PriceDiscTable _PriceDiscTableDiscount;

select firstOnly _PriceDiscTableDiscount
where
_PriceDiscTableDiscount.AccountRelation == PriceDiscTableDS.AccountRelation
&& _PriceDiscTableDiscount.ItemRelation == PriceDiscTableDS.ItemRelation
&& _PriceDiscTableDiscount.UnitId == PriceDiscTableDS.UnitId
&& _PriceDiscTableDiscount.ToDate >= today()
&& _PriceDiscTableDiscount.relation == PriceType::LineDiscSales;


return _PriceDiscTableDiscount.Percent1;
}

Leave Comment

Your email address will not be published. Required fields are marked *