Friday, February 23

AX 2012: How to get Exchange Rate from sales Quotation Record.

There are many ways out there to find out the exchange rate of the current record in sales quotation form but below is the standard way to fetch the valid exchange rate amount with valid time frame.



static void GetSalesQuotationTableExhRate(Args _args)
{
    date      _date = systemDateGet();
    SalesQuotationTable tb = SalesQuotationTable::find("ISO-000081");
    CustExchRate    exchRate = 0;
    if (tb.SettleVoucher == SettlementType::SelectedTransact && SalesParameters::find().UseSettleExchRate)
    {
        exchRate = tb.settleExchRate(false);
    }
    if (!exchRate)
    {
        if (tb.FixedExchRate)
        {
            exchRate = tb.FixedExchRate;
        }
        else
        {
            exchRate = Currency::exchRate(tb.CurrencyCode, _date);
        }
    }
    info(strFmt("%3: %1 - %2",tb.CurrencyCode,exchRate/100,tb.QuotationId));
}

Monday, February 19

SSRS Report: Serial Number in Report Table in AX 2012

Serial number on detail level can be achieved by

Add a new column as 'S.No.' in SSRS report. Open Expression window of the column and enter below text:
=RowNumber("<Datasetname>")

E.g., If my dataset name is "MyData" then the command will be:
=RowNumber("MyData")


OR if nothing to used and need normal number count as 1,2,3,4....n used:
=RowNumber(nothing);

Serial Number in Report Group SSRS Dynamics Ax 2012

But serial number shown on Group level is tricky because RowNumber not works there. For example in above mention scenario, Client wants serial number on Customer Group instead of Customer at detail level.
I used following single line SSRS expression helps me to achieve this.
=Runningvalue(Fields!FieldName.Value,countdistinct,”Dataset1″)





Popular Posts