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

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    You can check it by using:

    IF GUIALLOWED THEN

    //executed from a user

    ELSE

     //executed from a job

  • M.Zayed Profile Picture
    462 on at

    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

    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

  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at

    GUIALLOWED means called from user

    NOT GUIALLOWED - called from system

  • M.Zayed Profile Picture
    462 on at

    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
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

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

  • M.Zayed Profile Picture
    462 on at

    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

    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.

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

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 > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans