Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Unpicking

(0) ShareShare
ReportReport
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

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... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans