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)

How to check items with no any transaction by X++

(0) ShareShare
ReportReport
Posted on by 2,430

Hi Expert,

I am looking for X++ code to check items with no any transaction because somehow many items created unnecessary so I want to delete it. 

*This post is locked for comments

I have the same question (0)
  • Brandon Wiese Profile Picture
    17,790 on at

    I have actually done what you are attempting, i.e. deleted items "never" used.

    The problem with simply notexists join on InventTrans is that items can be used in other ways than simply as inventory.

    For example, some items are non-stock service items and never have InventTrans records, instead being used on Purchase order lines and Sales order lines.

    Some items can be used on Sales quotation lines.

    Or, used on Sales order lines, that were then confirmed (creating CustConfirmTrans records) and then deleted.

    And then there are Bill of material lines.

    The point is that if you want to delete InventTable records successfully, you'll have to consider all of the restricted relationships that AX itself will consider under validateDelete().

    Also, the effort can cascade upstream.  For example, on your first pass you might delete InventTable records and supporting bills of materials, and that might remove the final reference on additional InventTable records, and so on given however many levels your bills of materials might have.

    It's actually more challenging than it seems on the surface.

  • faiz7049 Profile Picture
    2,430 on at

    Thanks Crispin & Brandon for suggestion.

    Really it is not easly as its look.

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 March 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