web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Daily Sale Report for each store

(0) ShareShare
ReportReport
Posted on by

Hi guys !

I am working on Dynamics AX and I need to write a job that will send email at some specified email IDs. in that email daily sale report will be send in the form of text. I have written the code for sending email and I have obtained the daily sale. But I am stuck at obtaining the daily sale for each category. Like  a store "A" sales 4 category items e.g electronics, supermarket, crockery and clothing. Now I need to get daily sale category wise. I am getting data from RetailTransactionSaleTrans table. Is there any solution for this issue ?

Any help will be appreciated. Thanks in advance.

Please see the image for better understaning.

Best Regards:

reportformat.jpg

*This post is locked for comments

I have the same question (0)
  • Oksana Kovaliova Profile Picture
    3,597 on at

    Hi Muhammad,

    Single product (ItemId) can belong to multiple categories.
    What behavior is expected for the report in this case?

    If you need to find what categories product belongs to, you can use standard class ItemDataManager from Microsoft.Dynamics.Retail.Pos.DataManager.DLL:

    var itemManager = new ItemDataManager(PosApplication.Instance.Settings.Database.Connection, PosApplication.Instance.Settings.Database.DataAreaID);
    var productCategories = itemManager.GetCategoryHierarchy(itemId); //your ItemId from RetailTransactionSalesTrans in parameters

    Regards,
    Oksana

  • Community Member Profile Picture
    on at

    I think you misunderstood. I am doing this job in X++. I have created a job and coding in X++ in it.

    the code you provided in the comment is probably related to Retail POS SDK.

    Can you please guide me for AX( X++ ).

    Thanx by the way.

  • Verified answer
    venkatesh vadlamani Profile Picture
    3,180 on at

    RetailTransactionSalesTrans has itemID  ---> ecoresProduct --->EcoresProductCategory --->EcoresCategory-->EcoResCategoryHierarchy--->EcoResCategoryHierarchyRole

    you need to base the query on these tables.

    Based on the category hierarchy role you need to build your query. Like you have different hierarchies for different purposes namely retail,sales, procurement and supplementary.

    Categories you mentioned might not be on the same level you attached the item , for these you need to use nestedSetLeft and nestedSetRight fields on the ecoRescategory table. If its retail hierarchy then you can also use retailCategoryContainment table also.

    So request you to be more specific when you ask a question

  • Verified answer
    Oksana Kovaliova Profile Picture
    3,597 on at

    Hi Muhammad,

    Sorry for misunderstanding.

    AX OLAP Report 'Sales performance by category' can show sales split by category.

    2016_2D00_03_2D00_29_5F00_23_2D00_43_2D00_07.png

    So if we have a look how it works, it uses view EcoResProductCategoryExpanded to fetch item categories.

    Please, have a look if you can use this view to read item categories + please, consider that each category can have parent category - most probably you should also include sales for parent categories to your report:

    2016_2D00_03_2D00_29_5F00_23_2D00_43_2D00_07.png

    Regards,
    Oksana

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans