Posts

Showing posts from September, 2024

Convert Amount from one currency to another curency in d365 fo x++

    public real CurrentExchangeRate(CurrencyCode fromCurrency , CurrencyCode toCurrency , TransDate    transDate)     {         ExchangeRate      exchangeRate;         ExchangeRateType ExchangeRateType;         ExchangeRateCurrencyPair  exchangeRateCurrencyPair;         real              exchRate;         if( fromCurrency == toCurrency)         {             exchRate = 1;             return exchRate;         }         else         {             select firstonly exchangeRateCurrencyPair                 where exchangeRateCurrencyPair.ExchangeRateType == Ledger::find(Ledger::current...

how to add Date ranges in DP class in d365 fo x++

  if(startDate || endDate)         {             utcdatetime _fromDate = DateTimeUtil::newDateTime(startDate,0);             utcdatetime _toDate   = DateTimeUtil::newDateTime(endDate,86400);             qbr = SysQuery::findOrCreateRange(qbdsSalesLine, fieldNum(salesLine, CreatedDateTime));             range = SysQuery::range(_fromDate, _toDate);             qbr.value(range);         }