Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Purchase Order

Posted on by Microsoft Employee

I've created a field on the purchase order line called "Fully Received Date". When a purchase Order Line is created I need to check if the Outstanding Qty is zero then set the "fully Received Date" to WORKDATE. However running through the debugger I can't isolate where I would set this condition. I'm not sure if it's custom code or standard, if it is standard and suggestions on where to be looking? 

*This post is locked for comments

  • Verified answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Purchase Order

    Check the SETSELECTIONFILTER : Link https://msdn.microsoft.com/en-us/library/dd354931(v=nav.90).aspx

  • Verified answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Purchase Order

    Hi,

    As per you requirement when oustanding qty is zero then customized field should get updated . So the above code will work as program is checking outstanding qty is zero .

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Purchase Order

    Thank you! this code assumes that all the lines in the purchase order are received the same day. How can I Make it so it only affects the line selected and not all of them?

  • Andrea Antoniazzi Profile Picture
    Andrea Antoniazzi 285 on at
    RE: Purchase Order

    HI Lewishhh,

    you can add your code in the table 39 in the function InitOutstanding

    After the line

    "Completely Received" := (Quantity <> 0) AND ("Outstanding Quantity" = 0);

    You can add

    IF "Completely Received" THEN

    VALIDATE("Fully Received Date", WORKDATE);

    With this solution the "Fully Received Date" will be filled in also if the user manually set on the order the field Quantity equal to the field Received Quantity

    Best Regards

  • Suggested answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Purchase Order

    Is your requirement is to check the purchase order line is fully received and then update the date? If so as Amol said you can write the code on the post button. As user click the button to receive the items, system will check the each line related to PO and update the field  in the PO line.

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Purchase Order

    Hi,

    I would suggest write a custom code on Post button like

    If "Purchase Line".Outstanding Qty=0 THEN BEGIN

     Your code goes here.

    END;

    This code will execute after user receive the material.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans