D365 Finance & Operations and Dynamics AX Forum

Expand all | Collapse all

(Retail) Financial Dimension values on Retail Transactions

  • 1.  (Retail) Financial Dimension values on Retail Transactions

    SILVER CONTRIBUTOR
    Posted May 08, 2019 05:36 PM
    A product has associated Financial Dimensions. When a product is sold, a RetailTransaction record is created. However, we are not able to find which table contains the financial dimension values associated with that transaction. Can someone advise?

    ------------------------------
    Ken Champion
    Solution Consultant
    Arctic IT
    Metro Atlanta, GA
    ------------------------------


  • 2.  RE: (Retail) Financial Dimension values on Retail Transactions

    GOLD CONTRIBUTOR
    Posted May 09, 2019 12:27 PM
    Hi Ken,

    I had one of my Experts take a look at your question. I hope this helps!!

    RetailTransactionTable has a field called DefaultDimension, that field is a reference to the DimensionAttributeValueSet table, but if you need some code to show the details of the dimensions you can use the following X++ code
     
    static void displayDimensions(Args _args)
    {
        DimensionAttributeValueSetStorage   dimStorage;
        RetailTransactionTable              retailTransactionTable;
        DimensionStorageSegment             segment;
        int                                 i;
        ;
     
        while select firstOnly10 retailTransactionTable
        {
            info(retailTransactionTable.transactionId);
            dimStorage = DimensionAttributeValueSetStorage::find(retailTransactionTable.DefaultDimension);
            for(i=1; i <= dimStorage.elements(); i++)
            {
                info(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name);
                info(dimStorage.getDisplayValueByIndex(i));
            }
        }
    }
     
    You can also get the values through SQL, using the RetailTransactionTable.DefaultDimension
     
    DECLARE @DEFAULTDIMENSION AS BIGINT;
    SELECT NAME, DISPLAYVALUE FROM DEFAULTDIMENSIONVIEW WHERE DEFAULTDIMENSION = @DEFAULTDIMENSION


    ------------------------------
    Michael Gonzalez
    Account Executive
    Dynamics Resources
    Venon Hills IL
    ------------------------------



  • 3.  RE: (Retail) Financial Dimension values on Retail Transactions

    SILVER CONTRIBUTOR
    Posted May 09, 2019 02:33 PM
    Michael, thanks so much. This is exactly what I was seeking!

    ------------------------------
    Ken Champion
    Solution Consultant
    Arctic IT
    Metro Atlanta, GA
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role