Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Block Pick

Posted on by Microsoft Employee

I have a button on Firm Planned Production Order page Called "Block Pick" which wehn ticked should prevent the user from Being able to Create A Pick on the line. 

31.PNG

Once the user attempts to create a pick with this box selected it should error. Any ideas how to create this? 

Please Ask for any more information 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block Pick

    Thank you

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

    If seems, you are not writing in right place / page  / trigger.

    Try with following.  This should definitely work.

    IF ProductionOrder.GET("Status","Prod. Order No.") THEN

     IF ProductionOrder."Block Pick" THEN

       ERROR('TEXT0001');

  • Suggested answer
    RE: Block Pick

    Hi,

    Please attach a screenshot of your ProductionOrder variable as seen on C/AL Globals or C/AL Locals.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block Pick

    Creating the same error "Need to define No."

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block Pick

    36.PNGI'm stumped 

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block Pick

    IF ProductionOrder.GET("Status","No.") THEN

    IF ProductionOrder."Block Pick" THEN

      ERROR('TEXT0001');

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block Pick

    Thankyou, that was input just as me trying different things. 

    35.PNGHow can I fix this?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block Pick

    You should write this.

    IF ProductionOrder.GET("Status","Document No.") THEN

     IF ProductionOrder."Block Pick" THEN

       ERROR('TEXT0001');

  • Suggested answer
    RE: Block Pick

    Hi,

    If you are using GET, then you dont have to use FINDSET.

    ProductionOrder.GET("Document No.", "Status");

    IF ProductionOrder."Block Pick" THEN

    ERROR('TEXT0001');

    CreatePick(USERID,0,FALSE,FALSE,FALSE,'SMT'); // TIO000012 'S');

    Just this code will cater your purpose.

    Hope it helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block Pick

    I'm still getting an error saying it doesn't recognize Document No

    This is my current code

    ProductionOrder.FINDSET;

    ProductionOrder.GET("Document No.", "Status");

    IF ProductionOrder."Block Pick" THEN

    ERROR('TEXT0001');

    CreatePick(USERID,0,FALSE,FALSE,FALSE,'SMT'); // TIO000012 'S');

    I have variable defined as ProductionOrder as Production Order Subtype

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans