{"title":"Launch Copilot features using prompt actions","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-page-prompting-floating-actionbar/","by":"JOP-AL","license":"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/devenv-page-prompting-floating-actionbar, 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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-page-prompting-floating-actionbar","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn how to create prompt actions to promote AI capabilities in Business Central","date":"2026-10-02","meta":{"topic":"overview"},"outline":[{"level":1,"title":"Launch Copilot features using prompt actions","slug":"launch-copilot-features-using-prompt-actions","at":0,"chars":10657},{"level":2,"title":"Add prompt actions that launch Copilot features","slug":"add-prompt-actions-that-launch-copilot-features","at":1099,"chars":8627},{"level":3,"title":"Create a prompt action","slug":"create-a-prompt-action","at":2840,"chars":1280},{"level":3,"title":"Design guidelines and considerations","slug":"design-guidelines-and-considerations","at":4120,"chars":3732},{"level":3,"title":"Detailed example","slug":"detailed-example","at":7852,"chars":1874},{"level":2,"title":"Add a standard action that runs the prompt dialog page","slug":"add-a-standard-action-that-runs-the-prompt-dialog-page","at":9726,"chars":755},{"level":2,"title":"Related information","slug":"related-information","at":10481,"chars":176}],"text":"# Launch Copilot features using prompt actions\nMicrosoft Copilot in Business Central enables users to leverage AI-powered assistance directly within the application. To enhance user experience and promote Copilot capabilities, developers can create prompt actions that integrate seamlessly into the UI. These actions allow users to initiate Copilot features effortlessly, whether through a floating action bar or other prominent UI elements. This article provides an overview of how to implement prompt actions, design guidelines, and considerations for ensuring optimal functionality and visibility across different environments.\nIn this article, you learn how to add actions in the UI that users can select to start Copilot features. There are two approaches to creating these actions. Whichever approach you choose, the action must run the prompt dialog page for the Copilot feature. The recommended approach is to use a prompt action, which is specifically designed for Copilot features you want available on a page. The other approach is to use a standard action, as you would for other pages.\n## Add prompt actions that launch Copilot features\n> Applies to: Business Central 2024 release wave 1 (runtime 13) and later.\nYou use a prompt action to promote your Copilot feature on pages and encourage users to use it. In the UI, prompt actions associate actions directly with Copilot. They draw users' attention to tasks that Copilot can assist with a task on the page. Copilot might display these prompt actions elsewhere such as in the Copilot pane when asked for assistance.\nA prompt action is an action that appears in a highly visible area of the page. Depending on the page type, it could appear in the action bar, at the bottom or top of the page, and even in a floating action bar.\nOn List and Worksheet page types, prompt actions appear under the Start a Copilot prompt action icon in the page's action bar and also in a floating action bar as illustrated in the following figure for a List page. Users can hide the floating action bar by selecting Hide and bring it back by selecting Show in page.\n![Screenshot of a floating action bar for Copilot feature on list page]\nThe following table describes the prompt actions in the UI for other page types.\nCard, Document, ListPlus|ListPart|StandardDialog\n-|-|-\nPrompt actions appear with the Here's what Copilot can do on this page icon in the upper-right corner of the page.|Prompt actions appear in the Start a Copilot prompt action menu in part's action bar.|Prompt actions appear with the Here's what Copilot can do on this page icon at the bottom of the page.\n![Screenshot of a prompt action bar for Copilot feature on card page]|![Screenshot of a pompt action for Copilot feature on list part page]|![Screenshot of a prompt action for Copilot feature on standard dialog page]\n### Create a prompt action\nTo create prompt actions, you must create a new area in the actions section of the page object. The area must be set to `area(Prompting)`. You can then add one or more actions in the area and run a PromptDialog object that you want to activate when the action is clicked. Only objects of the PromptDialog page type can be run from a prompting area.\n> NOTE\n> The prompt actions only appear if you specify properties/devenv-runobject-property to the page.\nThe following example shows the syntax for how to create a prompt action that runs the My Prompt Dialog page. This piece of AL code can be added to a page where you want to promote the Draft a proposal functionality. When the action is clicked, the My Prompt Dialog page opens.\n```al\n...\nactions\n{\n    area(Prompting)\n    {\n        action(MyPromptAction)\n        {\n            Caption = 'Draft a proposal';\n            Image = Sparkle;\n            RunObject = page \"My Prompt Dialog\";\n        }\n    }\n}\n...\n```\nHere's an example if you're extending a list page:\n```al\n...\n\nactions\n{\n    addlast(Prompting)\n    {\n        action(MyPromptAction)\n        {\n            Caption = 'Draft a proposal';\n            Image = Sparkle;\n            RunObject = page \"My Prompt Dialog\";\n        }\n    }\n}\n...\n```\n### Design guidelines and considerations\n You should set the properties/devenv-image-property to either Sparkle\nor SparkleFilled ![Shows the Copilot sparkle filled icon].\nThese images are recognized across Microsoft products to indicate that the action is associated with Copilot. In general, use the Sparkle icon. Reserve the SparkleFilled icon for special cases where you want to emphasize a specific Copilot. For example, if there are multiple Copilot actions on a page, you might want to emphasize one Copilot action over the others.\n You shouldn't use \"Copilot\" in prompt action captions. Instead, focus on the assistive task that Copilot performs, starting with a verb such as draft, suggest, search, or troubleshoot.\n Prompt actions are supported on specific page types. Starting with runtime 13, the supported page types include List, ListPart, StandardDialog, and Worksheet. With runtime 14, the supported page types also include Card, Document, and ListPlus.\n Prompt actions are displayed only if the RunObject property is specified.\n Prompt actions are displayed in both Business Central online and on-premises environments. However, Microsoft Copilot is exclusively available for Business Central online. Therefore, it's good practice to display prompt actions only in online environments, not in on-premises environments. To make actions dynamically visible based on the deployment, use the properties/devenv-visible-property on prompt actions. For example, you can use one of the approaches described in the following sections. These approaches ensure that developers can view and test their prompt actions on their Docker container.\n  Based on deployment infrastructure:\n  The simplest approach is to use the EnvironmentInformation.IsSaaSInfrastructure()<https://learn.microsoft.com/dynamics365/business-central/application/system-application/codeunit/system.environment.environment-information> method to check whether the environment is online or on-premises and use the return value as an expression on the prompt action's properties/devenv-visible-property property. If the method returns true, then the environment is online, and the action is made visible. For example:\n  ```al\n  actions\n  {\n      addlast(Prompting)\n      {\n          action(MyPromptAction)\n          {\n              Caption = 'Draft a proposal';\n              RunObject = page \"My Prompt Dialog\";\n              Visible = IsSaaS;\n          }\n      }\n  }\n\n  var\n      IsSaaS: Boolean;\n\n  trigger OnOpenPage()\n  var\n      EnvInfo: Codeunit \"Environment Information\";\n\n  begin\n      IsSaaS := EnvInfo.IsSaaSInfrastructure()\n  end;\n  ```\n  Based on capability registration:\n  The preferred approach is to register the Copilot capability only if the environment is online (learn more in ai-build-capability-in-al#registering-an-ai-capability). Then, use the https://learn.microsoft.com/dynamics365/business-central/application/system-application/codeunit/system.ai.copilot-capability#iscapabilityregistered method on the prompt action's Visible property to check whether the capability is registered. If the method returns true, the Copilot capability is registered, and the action is visible. For example:\n  ```al\n  actions\n  {\n      addlast(Prompting)\n      {\n          action(MyPromptAction)\n          {\n              Caption = 'Draft a proposal';\n              RunObject = page \"My Prompt Dialog\";\n              Visible = IsCapabilityRegistered;\n          }\n      }\n  }\n\n  var\n      IsCapabilityRegistered: Boolean;\n\n  trigger OnOpenPage()\n  var\n      CopilotCapability: Codeunit \"Copilot Capability\";\n  begin\n      IsCapabilityRegistered := CopilotCapability.IsCapabilityRegistered(Enum::\"Copilot Capability\"::\"Draft a proposal\");\n  end;\n  ```\n### Detailed example\nThe next code is part of a code sample taken from the aka.ms/BCTech<https://aka.ms/BCTech> repo; the Job Planning Lines Copilot<https://github.com/microsoft/BCTech/blob/master/samples/AzureOpenAI/Advanced_SuggestJob/SuggestResource/JobPlanningLinesCopilot.PageExt.al> page extension. This code sample illustrates how to create two prompt actions that run the SuggestResourceCopilotAction and SuggestItemCopilotAction actions. The SuggestResourceCopilotAction action is used to suggest a resource to be assigned to a job planning line, and the SuggestItemCopilotAction action is used to suggest an item to be assigned to a job planning line. The SuggestResourceWithAI and SuggestItemWithAI functions aren't implemented in this code sample.\n```al\n...\nactions\n    {\n        addlast(Prompting)\n        {\n            action(SuggestResourceCopilotAction)\n            {\n                Caption = 'Suggest resource';\n                ToolTip = 'Asks Copilot which resource can be assigned to the job planning line. You will have to confirm the suggestion from Copilot.';\n                Visible = Rec.Type = Rec.Type::Resource;\n                ApplicationArea = All;\n\n                trigger OnAction()\n                begin\n                    SuggestResourceWithAI(Rec);\n                end;\n            }\n        }\n        addlast(Prompting)\n        {\n            action(SuggestItemCopilotAction)\n            {\n                Caption = 'Suggest item';\n                ToolTip = 'Asks Copilot which item can be assigned to the job planning line. You will have to confirm the suggestion from Copilot.';\n                Visible = Rec.Type = Rec.Type::Item;\n                ApplicationArea = All;\n\n                trigger OnAction()\n                begin\n                    Message('not implemented');\n                end;\n            }\n        }\n    }\n...\n```\n## Add a standard action that runs the prompt dialog page\nIf your Copilot feature is reached from a page that doesn't yet support Copilot prompt actions, you can use a standard action. This task is done similar to the way you add an action that opens any page. Except in this case, you target the prompt dialog page for your Copilot feature. You also apply a specific image so that users can easily recognize that the action is related to a Copilot feature.\nThe following code illustrates how to add an action that opens the prompt dialog page for Copilot feature:\n```al\naction(MyPromptDialogAction)\n{\n    Caption = 'Draft a proposal';\n    Image = Sparkle;\n\n    trigger OnAction()\n    begin\n        Page.RunModal(Page::\"My Prompt Dialog\");\n    end;\n}\n```\n## Related information\ndevenv-page-type-promptdialog\nPrompting using a prompt guide<devenv-page-promptguide>\nError handling in prompt dialogs<devenv-page-prompt-error-handling>"}