Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Block users if it does not fill the requested delivery date on the sales order page

Posted on by Microsoft Employee

Hi Guys,

I'm the IT respensible of my company I want to block the users if they not fill the requested delivery date on the sales order page.they can't create the warehouse shipment

2273.nav1.PNG

I think I have to write the code "ERROR" on the sales header table 36 can you please help me with that I'm still new to the dynamics nav world.

4478.nav2.PNG

Thanks 

Kind Regards

  • Bilal Haider Profile Picture
    Bilal Haider 45 on at
    RE: Block users if it does not fill the requested delivery date on the sales order page

    Sir Suresh's answer is looking more appropriate but the functionality can be achieved with my code as it is written on Action of create Warehouse not on insertion.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Block users if it does not fill the requested delivery date on the sales order page

    Hello,  if you add the code in the above screenshot it will just check the value when somebody inserts the value, the best place for you to add code is in codeunit 414,  or subscribe to the event OnBeforeRelease.

    After the Line

    TESTFIELD("Sell-to Customer No."); add the Line TESTFIELD("Requested Delivery Date");

    Warehouse Shipment cannot be created if the order is open, so the above logic will check for the Requested Delivery Date for them to Release.

  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 45 on at
    RE: Block users if it does not fill the requested delivery date on the sales order page

    Hi,

    It is very simple. Design page and go to the action Create &Whse. Shipment then open C/AL code using F9.

    Type these two lines of C/AL:

    IF "Requested Delivery Date" = 0D THEN

     ERROR('Put Requested Delivery Date');

    Now if user does not fills Requested delivery date he will get this error as below:

    Error-Comm.PNG

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Block users if it does not fill the requested delivery date on the sales order page

    Hi Marco,

    thanks for your reply but I  have basics on C/AL and were to put the code.

    I want the help on the code to use here to match this need.

  • Marco Mels Profile Picture
    Marco Mels on at
    RE: Block users if it does not fill the requested delivery date on the sales order page

    Hello,

    Maybe this helps:

    docs.microsoft.com/.../development

    Thanks.

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,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