Skip to main content

Notifications

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

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!

  • @rp@n Profile Picture
    @rp@n on at
    RE: need to update QTY (Purch.Qty) = 0 forr any item in purchase order

    Thanks Mohit

    Let me check and will update you

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: need to update QTY (Purch.Qty) = 0 forr any item in purchase order

    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
    @rp@n on at
    RE: need to update QTY (Purch.Qty) = 0 forr any item in purchase order

    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
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: need to update QTY (Purch.Qty) = 0 forr any item in purchase order

    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
    @rp@n on at
    RE: need to update QTY (Purch.Qty) = 0 forr any item in purchase order

    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?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: need to update QTY (Purch.Qty) = 0 forr any item in purchase order

    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.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: need to update QTY (Purch.Qty) = 0 forr any item in purchase order

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

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,996 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,853 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans