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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

need to update QTY (Purch.Qty) = 0 forr any item in purchase order

(0) ShareShare
ReportReport
Posted on by 30

Hi Team,

I like to update QTY (Purch.Qty) = 0 for any item in purchLine while adding new line in Purchase Order.

I noticed , When I select an Item and Config Id then only Qty get update in Purch.Qty. 

How we can skip this?

later user like to update the qty to 0 to some qty.

pls give me more shed on this.

thanks!

I have the same question (0)
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at

    You can write the code in modified field of PurchLine for these 2 fields post next.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, When ItemId is changed in Purchase order line, not only qty but many other fields gets updated in the system. If you update the Qty to zero after the system has called standard methods, I believe there will be data inconsistency issue because the fields are updated as per new Qty but later you have changed it to Zero. So better to change it to Zero first and then call standard methods.

    Please check ItemIdModified method in PurchLine Datasource in PurchTable form. There is a method modifyPurchQty in PurchLine table which will be called.

  • @rp@n Profile Picture
    30 on at

    Thanks Mohit,

    You mean to say to create a CoC for modifiedPurchQty and before next to assign purchLine.purchQty =0;

    Then call the standard method.

    Is it?

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Yes, create CoC on modifiedPurchQty method, check if PurchLine has RecId, if not then its a new line getting created. Check if your parameter is yes, then set PurchQty to zero else run the standard code.

  • @rp@n Profile Picture
    30 on at

    Thanks Mohit,

    In event handler,  we got the current record buffer. But in CoC , how will get the current record buffer?

    Becze I need to check for specific purchid and the line from the purchline.

    Pls give me more shed on this

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Yes, you will get current record in CoC as well. I think PurchLine buffer is parameter in this table, you can use that parameter to fetch value and set the value as per your requirement. Then call next statement.

  • @rp@n Profile Picture
    30 on at

    Thanks Mohit

    Let me check and will update you

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 555 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 364

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans