Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Printing Report & Checking if its was called by system or by user

(0) ShareShare
ReportReport
Posted on by 462

Usually on the request Page there is a Boolean field called "WithLog". This control wither the report would be printed with logo or not.

How can i check if the report was called by a user or by a background Process? Reason is i want the report to be always printed with logo if its was called with a background process.

*This post is locked for comments

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Printing Report & Checking if its was called by system or by user

    No, with the "Send order confirmation by mail" button the report is called by the NAV client (the user that click the button).

    GUIALLOWED is TRUE if the action is performed via the NAV Windows Client

    GUIALLOWED is FALSE if the action is performed by the NAV Job Queue (backgroun process).

    In your case, GUIALLOWED is TRUE when you click the "Send order confirmation by mail" button.

  • M.Zayed Profile Picture
    462 on at
    RE: Printing Report & Checking if its was called by system or by user

    On the sales order there is the fucntion "Send order conformation by mail". When you fire this action the report will be called on the background and it will be saved as PDF.

    Since the report is called int the Background , i consider this as a system action not a user action.  If i wrote the code like this "IF GUIALLOWED THEN "Mit Logo" := TRUE;" the Logo will always come no matter what. I tried to call the report from the development environment and now the logo is always printed.

    That's why I assume that  the correct code is "IF NOT GUIALLOWED THEN "Mit Logo" := TRUE; ". but still its not working.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Printing Report & Checking if its was called by system or by user

    You need to write IF GUIALLOWED THEN "Mit Logo" := TRUE;

  • M.Zayed Profile Picture
    462 on at
    RE: Printing Report & Checking if its was called by system or by user

    I did something like this on Trigger "OnPreReport":

    IF NOT GUIALLOWED THEN "Mit Logo" := TRUE;   ---> But its not working, I want the logo to be always printed if the report was called by the system.

  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at
    RE: Printing Report & Checking if its was called by system or by user

    GUIALLOWED means called from user

    NOT GUIALLOWED - called from system

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Printing Report & Checking if its was called by system or by user

    You can write a code like this:

    IF GUIALLOWED THEN

     withLogo := TRUE //this is called by a user in your system (user interface)

    ELSE

     withLogo := FALSE; //This is called by a job

  • M.Zayed Profile Picture
    462 on at
    RE: Printing Report & Checking if its was called by system or by user

    Hi, Thanks for your answer

    But I want something like this:

    If it was called from system then      -----> How to translate this?

     // withLogo = True;

    Else

    // withlogo =FALSE;

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Printing Report & Checking if its was called by system or by user

    You can check it by using:

    IF GUIALLOWED THEN

    //executed from a user

    ELSE

     //executed from a job

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans