web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Suppress Messages during a report i.e Confirmation, Standard Dialog.

(0) ShareShare
ReportReport
Posted on by 380

Hello,

I am trying to create a report to batch post warehouse shipments withing NAV 2018. I have it working calling the posting codeunit, however, it has a pop up message for every record that would be reported. i.e selected ship or ship and invoice, and also, the confirmation that the document posted. How can i code into a report to handle these with predetermined values? I know its been done elsewhere in the system but I could not figure it out.

Please do not suggest the other dev forums, cause I cant ask a question on there.

Thanks,

-Chaz Kim

I have the same question (0)
  • Suggested answer
    Lars Lohndorf-Larsen Profile Picture
    on at

    Hi Chaz,

    For sales posting, you could call codeunit 80.RUN (not 81 which is the one called in the UI). And call it with a SalesHeader record, which you first mark with post and / or ship - something like this, done for each record in a loop:

    SalesHeader.Ship := TRUE;
    SalesHeader.Invoice := TRUE;
    SalesPost.RUN(SalesHeader); //SalesPost = Codeunit 80

    Note that on codeunit 80 there are a number of other functions like SetPreviewMode and SetSuppressCommit, that you can call before the posting. These functions take a paramater and store it in a global variable, so if you need to exten this you could add a function to codeunit 80 called "SetShowDialog", and call that. Then amend the code so instead of for example:

    MESSAGE('Posting completed.');

    to

    IF NOT ShowDialog THEN

      MESSAGE('Posting Completed.');

    I hope you see what I mean?

  • ChazKimRP Profile Picture
    380 on at

    Hello,

    thanks for the response, I am trying to do warehouse shipment batch posting so it would be codeunit 

    5764 i thought. unless I should be using 
    5763
  • Verified answer
    Lars Lohndorf-Larsen Profile Picture
    on at

    Hi, yes exactly - use codeunit 5763 instead, if you want to bypass the manual input. Also notice that on record 7321 there is a function that looks like it turns off Dialogs. So you can try with something like this (not tested here):

    OnRun()

    WarehouseShipmentLine.SetHideValidationDialog(TRUE);

    WhsePostShipment.SetPostingSettings(TRUE);

    WhsePostShipment.RUN(WarehouseShipmentLine);

    variables:

    Name DataType Subtype Length

    WarehouseShipmentLine Record Warehouse Shipment Line

    WhsePostShipment Codeunit Whse.-Post Shipment

    this kind of simulates the code from codeunit 5764, but instead of asking user if they want to Invoice, you make that choice in your own code. I hope this gets you one step further,

  • ChazKimRP Profile Picture
    380 on at

    This is it! except I didnt have to use the validation portion, in the report i pass a variable if I want to invoice, so then used that for the value in WhsePostShipment.SetPostingSettings which still allows the user flexability.

    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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,594

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 745 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 530

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans