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)

Inventory transactions(Sales,Purch,Movement and etc) validation for Item

(0) ShareShare
ReportReport
Posted on by

Hi All,

I'm facing issue to find place where I can add validation for InventTable one new field.

If it is not filled, I should not allow any Invent transaction. Is there any place/class where I can put validation on one place and it would check on every process. If it would be Sales Order, Purch Order, Inventory Movement and so on?

Or I should add validations separately for all processes?

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

    If you don't want to allow any inventory transaction just throw exception on insert of InventTrans table, but do you really want this ? It sound strange.

  • Mantas Vysniauskas Profile Picture
    on at

    Client wants :) Not me :)

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    I don't think if data is ever inserted directly in InventTrans.  As you said yourself it comes though sources (PO, SO lines etc.)

    So how about making fields mandatory in source location and as validation you can put validation on InventTans using TransactionType

  • Mantas Vysniauskas Profile Picture
    on at

    The point is I don't want to touch sources. I want to add only one validation on the main connecting place. For example like ievgen Miroshnikov said, to add on InventTrans validateWrite. i'm testing it now. But also not sure how it will effect source if InventTrans will be not valid.

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    The bad news for you is that insert operations do not require a TTS transaction block, thus throwing an error is not going to help in many cases, because there is no transaction to roll back during record creation for InventTrans.

    You could try to override the aosValidateInsert method and throw an error there on InventTrans which is being called no matter what (insert/doInsert), unless AOS validations are explicitly turned off in code (which is very rare). But that is not going to ensure that the creation of the parent record (origin, through InventTransOrigin) is not being inserted, and you are potentially going to end up with broken record references.

    The only possible way to do this correctly is by identifying that in which scenarios do you want to prevent creating an inventory transaction, and change each and every places where you want to raise the error (such as SalesLineType, PurchLineType, various inventory movement classes, etc.).

    Due to this I would tell the customer that this is technically not feasible or worth the effort, and would be too much effort to implement it and maintain the customization for future hotfixes and upgrades..

    As an alternative solution, when the product is released, during validation you could check if your mandatory fields are filled in and if not, you could put the product on hold for specific transaction types. I believe that is set in the "Default order settings" and "Site specific order settings" on the product.

  • Mantas Vysniauskas Profile Picture
    on at

    Thanks for your comments. Now I think I know what to do :)

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans