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 void item through code

(0) ShareShare
ReportReport
Posted on by

Hello guys !

I am working on voiding an item through code. Retail POS provides Application.runOperation method through which we can call different operations. we can also call voiditem operation through it which works.

but its working is not as it should be we call it this way:

application.RunOperation(PosisOperations.VoidItem,item.ItemId,RetailTransaction);

Now suppose there are 5 items in the transaction. we explicitly give this call item id so that it may be clear that which item has to be voided. but it sometimes voids the same item but most of the time it voids the wrong item.

anyone have encountered this odd behavior of POS and Application.runOperation ???

How can we correct it ? 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    actually it always voids the selected item. while i dont want to do that. i need to override and need to void the item that i give item id of.  

  • Community Member Profile Picture
    on at

    Are you selecting the line you want to void every time before running your method?

  • Community Member Profile Picture
    on at

    no but there is always an item selected in the item grid.

    in my case i provide the item id explicitly and regardless of item selected i want to void item that i provided the item id of.

  • Oksana Kovaliova Profile Picture
    3,597 on at

    Hi,

    Try the following way:

    1) loop through all products in the transaction;

    2) find line IDs you need to void;

    3) execute 'VoidItem' operation for every line - specifying Line ID as shown on below code pictures (using OperationInfo object).

    Void-items.png

    Void-items.png

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
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans