Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Is GUIALLOWED still needed in NAV 2016?

(0) ShareShare
ReportReport
Posted on by

I am learning development in NAV (using the eBook Programming Microsoft Dynamics NAV by David and Christopher Studebaker). The authors stated that "in previous versions of NAV the dialog function statements had to be conditioned with the GUIALLOWED function". They then said that as of NAV 2015 the NAV application server and Web Services "simply ignore the dialogue functions".

So my question is... in NAV 2016 and NAV 2015 is GUIALLOWED a legacy function and is it no longer needed? Are there any situations where it is still needed in NAV 2016/2015?

*This post is locked for comments

  • JPages Profile Picture
    on at
    RE: Is GUIALLOWED still needed in NAV 2016?

    IF GUIALLOWED = TRUE THEN

    ERROR always causes an error, and the program rollback the transaction and finalizes its execution. If the code has been called from an external program, it will receive an error from C/AL and NAV Server. The error text will be recorded into event log of the computer that is running Microsoft Dynamics NAV Server.

    MESAGE will record its value into event log of the computer that is running Microsoft Dynamics NAV Server.

    CONFIRM will raise an error because its execution is forbiden.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Is GUIALLOWED still needed in NAV 2016?

    Hi,

    Actually, web service would simply ignore the dialog and error message and would record the errors in Event Viewer even though you are not using GUIALLOWED function.

    Additionally, it seems that, NAS also does not require this function and hence this GUIALLOWED function is removed from the posting routines (like Codeunit 80 or 90) in newer version.

    I really doubt, how beneficial this function would be in future as both Web Service & NAS are being managed without this function.

  • Verified answer
    JPages Profile Picture
    on at
    RE: Is GUIALLOWED still needed in NAV 2016?

    When the session is not GUIALLOWED, MESSAGE won't raise an error, but is recorded in the event log of the computer that is running Microsoft Dynamics NAV Server.

  • Verified answer
    RockwithNav Profile Picture
    6,731 on at
    RE: Is GUIALLOWED still needed in NAV 2016?

    Hey Theodre,

    Yes GUIALLOWED will always be needed I belief and in any of the upcoming versions. You will feel the need of this when you will do Integration with different platforms like .NET and will use the Web Services. There are some keywords like CONFIRM - YIELD - SLEEP are not allowed when a web service is executed so you need to use GUIALLOWED to skip these codes.

    Check out the below links these are not allowed in Web Services so need to use GUIALLOWED

    msdn.microsoft.com/.../dd301080.aspx

    help.lsnav80.lsretail.com/.../conHandlingUIInteractionWhenWorkingWithWebServices.htm

  • Verified answer
    Luc van Vugt Profile Picture
    on at
    RE: Is GUIALLOWED still needed in NAV 2016?

    Sure it is still needed as this checks whether the code is run on session with a UI or not.

    GUIALLOWED will return, for example, false when the code is run as part of a web service, as a web service does not "have" a UI. In this case calling MESSAGE, CONFIRM, etc. should not be made as these need a UI. The same applies to code run on a NAS.

    When code is ran in a session with UI, e.g. through the WIndows or Web client, GUIALLOWED will yield true.

  • Verified answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at
    RE: Is GUIALLOWED still needed in NAV 2016?

    Hi Theodore,

    I am working on NAV 2016, and I just check my standard product codebase, and there are instances where GUIALLOWED is still present. I think Microsoft has carried forward legacy code which is there since ages.

    Check Table 14 (Location), Field 5703 (City) and the OnValidate() trigger.

    I am not quite sure how it is handled on web services call. Thank you for the headsup.

    Hope it helps.

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

🌸 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…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans