You would need to use the on-click property of the command button. Reference: https://support.microsoft.com/en-gb/office/use-a-command-button-to-start-an-action-or-a-series-of-actions-c7bf2 https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/action-controls