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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans