Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Unpicking

Posted on by Microsoft Employee

I currently have code which checks when a user tries to delete a item from released production order's and errors If there are currently picked items. I then ask the user if they want to Unpick these items. How would I go about Writing this. 

I figure I need to get the routing lines for the production order and then call a function called "Unpick" for example (I have one created for this) 

"For each routing line, call the relevant function  with the routing link code (SMT, TH etc) from the Routing Lines above."

These are the filters I use on the Routing page 

27.PNG

This is my code so far 


recWarehouseEntry.SETRANGE("Source No.","No.");
IF recWarehouseEntry.FINDFIRST THEN
CONFIRM('Cannot delete as there are picked items. Do you wish to unpick?', FALSE) = TRUE THEN

Any and all feedback is appreciated! 

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unpicking

    You need to pass the record variable as 5406 (Prod. Order Line) not 5405.

    Instead of rec, try to pass recProdLine variable. It should work.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unpicking

    Thanks, I've chosen a different direction however I've cam across this error. Any idea how to solve it I'm net to trying to pass the functions across. 

    28.PNG

  • Suggested answer
    RE: Unpicking

    Hi,

    Upon confirmation from the user, you can keep an indication probably a Boolean to mark these records as picked.

    Code will look something like this. Please understand that this isnt the full implementation. There can be other considerations too.

    *****

    recWarehouseEntry.SETRANGE("Source No.","No.");

    IF recWarehouseEntry.FINDFIRST THEN

    BEGIN

      IF CONFIRM('Cannot delete as there are picked items. Do you wish to unpick?') THEN

      BEGIN

         recWarehouseEntry.Picked := TRUE;

         recWarehouseEntry.MODIFY;

      END;

    END;

    *****

    Hope it helps.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans