# System.GuiAllowed() Method
> Version: _Available or changed with runtime version 1.0._
Checks whether the AL code can show any information on the screen.
## Syntax
```al
Ok :=   System.GuiAllowed()
```
> NOTE
> This method can be invoked using property access syntax.
> NOTE
> This method can be invoked without specifying the data type name.
## Return Value
Ok
Type: ../boolean/boolean-data-type
## Remarks
The System.GuiAllowed method returns true if the session where your AL code is running allows you to use methods that interact with the user, such as ../dialog/dialog-open-method, ../dialog/dialog-update-method, or ../dialog/dialog-close-method.
If the same codeunit needs to run both in the UI but also in the background (in a scheduled task or with a job queue entry) or in a web service call (SOAP/OData/API), then use `if GuiAllowed() then` calls to encapsulate AL code that interacts with the user.
## Example
This example shows how to use the GuiAllowed method.
```al
if GuiAllowed then
    Message('Code is running on a client.');
```
If the code runs on a client, which means that the user interface is available, a message box appears with the following message.
Code is running on a client
If the code runs in a web service call or in the background, then the message won't be displayed.
## Example (Shopify integration)
This example shows how the Shopify integration uses GuiAllowed to provide feedback to the user when the code is running in the client, while allowing the business logic to also run in the background or being called from a web service.
```al
procedure AddItemToShopify(Item: Record Item; ShopifyShop: Record "Shpfy Shop")
var
    ProgressDialog: Dialog;
begin
    if GuiAllowed then begin
        ProgressDialog.Open(DialogMsg);
        ProgressDialog.Update(1, SyncInformationProgressLbl);
    end;

    // business logic code here

    if ShopifyShop."Sync Item Images" = ShopifyShop."Sync Item Images"::"To Shopify" then begin
        if GuiAllowed then
            ProgressDialog.Update(1, FinishSyncProgressLbl);
        // business logic code here
    end;

    // some more business logic
end;
```
## Related information
system-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-guiallowed-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-guiallowed-method/
