### Register an Assisted Setup Guide and Category Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-designing-navigate-pages Subscribes to the OnRegisterAssistedSetup event to insert a new guide into the Guided Experience table and extends the Assisted Setup Group enum to include a custom category. ```AL codeunit 50100 "AddToDoAssistedSetup" { [EventSubscriber(ObjectType::Codeunit, Codeunit::"Guided Experience", 'OnRegisterAssistedSetup', '', true, true)] local procedure OnRegisterAssistedSetup() var AssistedSetup: Codeunit "Guided Experience"; GuidedExperienceType: Enum "Guided Experience Type"; AssistedSetupGroup: Enum "Assisted Setup Group"; VideoCategory: Enum "Video Category"; begin if not AssistedSetup.Exists(GuidedExperienceType::"Assisted Setup", ObjectType::Page, Page::"ToDoAssistedSetup") then AssistedSetup.InsertAssistedSetup( // Link text for the assisted setup guide 'Add a to-do', // Short description, not shown on page 'Create a task for your team', // Text that shows in Description column 'Register a task for your team and assign people', 1, ObjectType::Page, Page::ToDoAssistedSetup, // Assign guide to Task category AssistedSetupGroup::Tasks, //Video URL not required '', VideoCategory::Uncategorized, //Help URL not required ''); end; } enumextension 50100 MyEnumExtension extends "Assisted Setup Group" { value(100; Tasks) { } } ``` -------------------------------- ### Example Request for generalLedgerSetup Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_generalledgersetup_get A concrete example of the GET request URL for the general ledger setup API. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/generalLedgerSetup({id}) ``` -------------------------------- ### Example Request Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_opportunity_get A concrete example of the GET request URL. ```JSON GET https://{businesscentralPrefix}/api/v2.0/companies({id})/opportunities({id}) ``` -------------------------------- ### Install App Response Formats Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/administration-center-api_app_management Examples of successful and error responses for the installation operation. ```JSON { "id": guid, // ID of the operation used for tracking the update request "type": string, // Type of the operation, for this endpoint, it's "install" "sourceAppVersion": string, // Current version of app on the tenant. In case of Install, it is always empty as no version is installed "targetAppVersion": string, // Version of app that will be installed. "status": string, // An enum that indicates the status. Values include: "scheduled", "running", "succeeded", "failed", "canceled", "skipped" "createdOn": datetime, // Date and time the request was created "errorMessage": string // Error message for failed operations } ``` ```JSON { "code": string, // Error code "message": string, // Detailed error message "data": { // Any additional data for the error. For example, when "installOrUpdateNeededDependencies" in the request body was set to false, and there are dependencies that must be first installed or updated. "requirements": [ // List of requirements you need to fulfil before you can run the request { "appId": guid, "name": string, "publisher": string, "version": string, "type": string // (enum | "install", "update", "uninstall") } ] } } ``` -------------------------------- ### Example Request for pbiEmployeeAbsences Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-analytics/api/dynamics_pbiemployeeabsence_get A concrete example of the GET request URL. ```json GET https://{businesscentralPrefix}/api/microsoft/analytics/v1.0/companies({companyId})/pbiEmployeeAbsences ``` -------------------------------- ### RunSetup Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.bank.payment.payment-registration-mgt. Executes the payment registration setup wizard to configure default settings. ```AL procedure RunSetup() ``` -------------------------------- ### LaunchWizard Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/o365-getting-started-mgt. Initiates the Getting Started wizard. ```AL procedure LaunchWizard(UserInitiated: Boolean, TourCompleted: Boolean): Boolean ``` -------------------------------- ### GET Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_documentattachment_get An example of a full GET request URL for a document attachment. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/documentAttachments({id}) ``` -------------------------------- ### Example Request for Get contacts Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_contact_get A concrete example of the GET request URL for a contact. ```JSON GET https://{businesscentralPrefix}/api/v2.0/companies({id})/contacts({id}) ``` -------------------------------- ### OpenSetupWindow Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/o365-sync.-management Opens the setup window for O365 synchronization. ```AL procedure OpenSetupWindow(): Boolean ``` -------------------------------- ### InitializeFromSetup Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/report/microsoft.inventory.requisition.calculate-plan---req.-wksh. Initializes the report settings from the setup configuration. ```AL procedure InitializeFromSetup() ``` -------------------------------- ### Get vendors request example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-analytics/api/dynamics_vendor_get A concrete example of the HTTP GET request URL. ```http GET https://{businesscentralPrefix}/api/microsoft/analytics/v1.0/companies({companyId})/vendors ``` -------------------------------- ### GET Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/api/dynamics_usergrouppermission_get An example of a full GET request URL for the userGroupPermission resource. ```JSON GET https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v2.0/companies({companyId})/userGroups({userGroupId})/userGroupPermission({userGroupPermissionId}) ``` -------------------------------- ### Setup Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.sales.reminder.create-reminder-action Performs the setup for the reminder action. ```AL procedure Setup() ``` -------------------------------- ### Get salespersonPurchaser Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salespersonpurchaser_get An example of the GET request URL for a specific salesperson purchaser. ```JSON GET https://{businesscentralPrefix}/api/v2.0/companies({id})/salespeoplePurchasers({id}) ``` -------------------------------- ### Get dimensionValues Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_dimensionvalue_get Example of a GET request to retrieve a specific dimension value. ```json GET https://{businesscentralPrefix}/api/v2.0/companies({id})/dimensions({id})/dimensionValues({id}) ``` -------------------------------- ### SetupIsInPlace Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.finance.financialreports.trial-balance-mgt. Checks if the trial balance setup is correctly configured. ```AL procedure SetupIsInPlace(): Boolean ``` -------------------------------- ### Get customerPayment Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_customerpayment_get Example of a GET request to retrieve a customer payment by ID. ```json GET https://{businesscentralPrefix}/api/v2.0/companies({id})/customerPaymentsJournals({id})/customerPayments({id}) ``` -------------------------------- ### Initialize the documentation repository Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/help/help-aldoc-generate-help Use the init command to unpack support files and create the DocFx configuration. ```bash {path_to_aldoc}\aldoc.exe init -o .\{path-to-generated-content}\ -t '{path_to_package1}','{path_to_package2}',...,'{path_to_package3}' ``` ```bash # Example .\aldoc\aldoc.exe init -o .\mypath\ -t 'F:\AL\.alpackages\Microsoft_System Application_23.0.00000.0.app' ``` -------------------------------- ### Writing a GUID to a file Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/file/file-write-guid-method Example demonstrating how to open a file for writing and save a GUID value to it. ```AL var FileName: Text; TestFile: File; Guid1: GUID; begin FileName := 'C:\TestFolder\TestFile.txt'; if Exists(FileName) then begin TestFile.WriteMode(True); TestFile.Open(FileName); TestFile.Write(Guid1); TestFile.Close; end else Message('%1 does not exit.', FileName); end; ``` -------------------------------- ### Create an Assisted Setup Guide with NavigatePage Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-designing-navigate-pages Implements a three-step wizard using the NavigatePage type, utilizing temporary source tables and conditional group visibility. ```AL page 50111 ToDoAssistedSetup { PageType = NavigatePage; SourceTable = "To-do"; SourceTableTemporary = true; Caption = 'Add a To-Do for the Team'; layout { area(Content) { group(Step1) { Visible = Step1Visible; group("Welcome") { Caption = 'Welcome to the to-do assisted setup'; group(group11) { Caption = ''; InstructionalText = 'Use this guide to register a to-do task for you and your team.'; } } group("Let's go") { Caption = 'Let''s go'; group(group12) { Caption = ''; InstructionalText = 'Select Next to get started.'; } } } group(Step2) { Caption = 'Enter information about the to-do task'; Visible = Step2Visible; group("11") { Caption = 'Add attendees and fill in details'; part(AttendeeSubForm; "Attendee Wizard Subform") { } } field("No."; Rec."No.") { ApplicationArea = All; Visible = false; } field("Type"; Rec."Type") { ApplicationArea = All; Caption = 'What type is the to-do?'; } field("Date"; Rec."Date") { ApplicationArea = All; Caption = 'What''s the start date?'; } field("Description"; Rec.Description) { ApplicationArea = All; InstructionalText = 'Example of a description'; Caption = 'Describe your to-do'; } field("Start Time"; Rec."Start Time") { ApplicationArea = All; Caption = 'What''s the start time?'; } field("Duration"; Rec."Duration") { ApplicationArea = All; Caption = 'How long does it last?'; } field("Team To-do"; Rec."Team to-do") { ApplicationArea = All; Caption = 'Team to-do'; } field("All Day Event"; Rec."All Day Event") { ApplicationArea = All; Caption = 'All Day Event'; } field("Ending Date"; Rec."Ending Date") { ApplicationArea = All; Caption = 'What''s the end date?'; } field("Ending Time"; Rec."Ending Time") { ApplicationArea = All; Caption = 'What''s the end time?'; } // } } group(Step3) { Caption = 'That''s it!'; InstructionalText = 'Select Finish to save the to-do.'; Visible = Step3Visible; } group(StandardBanner) { Caption = ''; Editable = false; Visible = TopBannerVisible and not FinishActionEnabled; field(MediaResourcesStandard; MediaResourcesStandard."Media Reference") { ApplicationArea = All; Editable = false; ShowCaption = false; } } group(FinishedBanner) { Caption = ''; Editable = false; Visible = TopBannerVisible and FinishActionEnabled; field(MediaResourcesDone; MediaResourcesDone."Media Reference") { ApplicationArea = All; Editable = false; ShowCaption = false; } } } } ``` -------------------------------- ### Get customerContact Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_customercontact_get An example of the HTTP GET request to retrieve a customer contact. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/customerContacts({id}) ``` -------------------------------- ### Init Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.pricing.calculation.price-calculation---undefined Initializes the calculation with the provided line and setup. ```AL procedure Init(LineWithPrice: Interface "Line With Price", PriceCalculationSetup: Record "Price Calculation Setup") ``` -------------------------------- ### Example HTTP GET requests Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_customer_get Examples of standard and expanded GET requests for customer data. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/customers({id}) GET https://{businesscentralPrefix}/api/v2.0/companies({id})/customers({id})?$expand=customerFinancialDetails, picture, defaultDimensions, currency, paymentTerm, shipmentMethod, paymentMethod GET https://{businesscentralPrefix}/api/v2.0/companies({id})/customers({id})?$expand=picture, currency, paymentMethod ``` -------------------------------- ### TestSetup Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.eservices.onlinemap.online-map-management Verifies the current setup configuration. ```AL procedure TestSetup(): Boolean ``` -------------------------------- ### Get userPermission Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/api/dynamics_userpermission_get Example of a GET request to retrieve a specific user permission. ```JSON GET https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v2.0/companies({companyId})/users({userSecurityId})/userPermissions({userPermissionId}) ``` -------------------------------- ### Install Base Application Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrading-cumulative-update-v27 Installs the Base Application extension. Replace $ExtVersion with the specific version of the published application. ```PowerShell Install-NAVApp -ServerInstance $BcServerInstance -Name "Base Application" -Version $ExtVersion ``` -------------------------------- ### LaunchWizard Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/o365-getting-started-mgt. Launches the getting started wizard based on user and tour status. ```APIDOC ## LaunchWizard ### Description Launches the getting started wizard. ### Signature `procedure LaunchWizard(UserInitiated: Boolean, TourCompleted: Boolean): Boolean` ### Parameters - **UserInitiated** (Boolean) - **TourCompleted** (Boolean) ### Returns - **Boolean** ``` -------------------------------- ### Get salesInvoiceLine Request Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salesinvoiceline_get An example of a GET request to retrieve a specific sales invoice line. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/salesInvoices({id})/salesInvoiceLines({salesInvoiceLineId}) ``` -------------------------------- ### Create a File Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/file/file-create-method Demonstrates creating a file named TestFile.txt in a specific directory and handling the success or failure of the operation. ```AL var TestFile: File; begin if TestFile.Create('C:\TestFolder\TestFile.txt') then begin Message('%1 is created', TestFile.Name); end else Error('The file could not be created'); end; ``` -------------------------------- ### Example GET request for dimensions Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_dimension_get A concrete example of the GET request URL using the Business Central API endpoint. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/dimensions({id}) ``` -------------------------------- ### Initialize Setup Record in AL Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/ai-agent-sdk-setup-page Prepares the setup page by setting default values for new agents or loading existing configurations from the database. ```AL local procedure InitializeSetupRecord(var TempMyAgentSetup: Record "My Agent Setup" temporary; var AgentSetupBuffer: Record "Agent Setup Buffer") var MyAgentSetupRecord: Record "My Agent Setup"; AgentSetup: Codeunit "Agent Setup"; begin // For new agents, set default values for custom properties // For existing agents, load current configuration if IsNullGuid(TempMyAgentSetup."User Security ID") then TempMyAgentSetup."Custom Property" := 'Default Value' else if MyAgentSetupRecord.Get(TempMyAgentSetup."User Security ID") then TempMyAgentSetup.TransferFields(MyAgentSetupRecord, false); if TempMyAgentSetup.IsEmpty() then TempMyAgentSetup.Insert(); // Initialize the Agent Setup Buffer with agent metadata if AgentSetupBuffer.IsEmpty() then AgentSetup.GetSetupRecord( AgentSetupBuffer, TempMyAgentSetup."User Security ID", Enum::"Agent Metadata Provider"::"My Agent", 'My Agent - ' + CompanyName(), // Agent name 'My Agent', // Display name 'Description of what this agent does.'); // Summary end; ``` -------------------------------- ### SetUpNewLine Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/table/microsoft.warehouse.internaldocument.internal-movement-line Initializes a new line based on the last internal movement line. ```AL procedure SetUpNewLine(LastInternalMovementLine: Record "Internal Movement Line") ``` -------------------------------- ### Implement Install Logic with ModuleInfo Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-extension-install-code Example of using the OnInstallAppPerDatabase trigger to differentiate between a fresh installation and a reinstallation by checking the DataVersion property. ```AL codeunit 50100 MyInstallCodeunit { Subtype=Install; trigger OnInstallAppPerDatabase(); var myAppInfo : ModuleInfo; begin // Get info about the currently executing module NavApp.GetCurrentModuleInfo(myAppInfo); // A 'DataVersion' of 0.0.0.0 indicates a 'fresh/new' install if myAppInfo.DataVersion = Version.Create(0,0,0,0) then HandleFreshInstall else // If not a fresh install, then we are Re-installing the same version of the extension HandleReinstall; end; local procedure HandleFreshInstall() begin // Do work needed the first time this extension is ever installed for this tenant. // Some possible usages: // - Service callback/telemetry indicating that extension was installed // - Initial data setup for use end; local procedure HandleReinstall() begin // Do work needed when reinstalling the same version of this extension back on this tenant. // Some possible usages: // - Service callback/telemetry indicating that extension was reinstalled // - Data 'patchup' work, for example, detecting if new 'base' records have been // changed while you have been working 'offline'. // - Setup 'welcome back' messaging for next user access. end; } ``` -------------------------------- ### Example Request Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/financereportsapi/api/dynamics_detailedvendorledgerentry_get An example of a GET request to the detailedVendorLedgerEntries endpoint. ```json GET https://{businesscentralPrefix}/api/v2.0/companies({id})/detailedVendorLedgerEntries({id}) ``` -------------------------------- ### Install extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v14-v15 Install the synchronized extension for the specified tenant. ```PowerShell Install-NAVApp -ServerInstance -Name "" -Version -tenant ``` -------------------------------- ### Set up cloud migration via POST Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/cloudmigrationapi/cloud-migration-api-overview Initiate the cloud migration setup by sending a POST request with the product ID, SQL server type, and connection string. ```JSON POST https://api.businesscentral.dynamics.com/v2.0/{aadTenantID}/{environment name}/api/microsoft/cloudMigration/v1.0/companies({companyId})/setupCloudMigration Authorization: Bearer {token} Content-type: application/json Body: { "productId":"{ProductID}", "sqlServerType":"{SqlServerType}", "sqlConnectionString":"{SqlConnectionString}" } ``` -------------------------------- ### Example Request for vendorPaymentJournals Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_vendorpaymentjournal_get A concrete example of the GET request URL. ```JSON GET https://{businesscentralPrefix}/api/v2.0/companies({id})/vendorPaymentJournals({id}) ``` -------------------------------- ### Install Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v14-v18 Installs a specific extension on a tenant. ```PowerShell Install-NAVApp -ServerInstance -Name "" -Version -tenant ``` -------------------------------- ### Install System Application Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrading-cumulative-update-v27 Installs the System Application extension. Replace $ExtVersion with the specific version of the published application. ```PowerShell Install-NAVApp -ServerInstance $BcServerInstance -Name "System Application" -Version $ExtVersion ``` -------------------------------- ### Example Request for unitsOfMeasure Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_unitofmeasure_get A concrete example of the GET request URL. ```http GET https://{businesscentralPrefix}/api/v1.0/companies({id})/unitsOfMeasure({id}) ``` -------------------------------- ### SetupIsInPlace Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.finance.financialreports.trial-balance-mgt. Checks if the trial balance setup is correctly configured. ```APIDOC ## procedure SetupIsInPlace(): Boolean ### Description Verifies if the necessary setup for the trial balance is in place. ### Returns - **Boolean** - Returns true if setup is complete, otherwise false. ``` -------------------------------- ### Example Request for taxAreas Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_taxarea_get A concrete example of the GET request URL. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/taxAreas({id}) ``` -------------------------------- ### Create setupCloudMigrations Request and Response Examples Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/cloudmigrationapi/api/dynamics_setupcloudmigration_create Example JSON request and response payloads for the setupCloudMigrations creation operation. ```json POST https://{businesscentralPrefix}/api/v1.0/companies({id})/setupCloudMigrations({id}) Content-type: application/json { "id" : "", "productId" : "", "sqlServerType" : "", "sqlConnectionString" : "", "runtimeName" : "", "runtimeKey" : "" } ``` ```json HTTP/1.1 201 Created Content-type: application/json { "id" : "", "productId" : "", "sqlServerType" : "", "sqlConnectionString" : "", "runtimeName" : "", "runtimeKey" : "" } ``` -------------------------------- ### Install Application Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrading-cumulative-update-v27 Installs the Application extension. Replace $ExtVersion with the specific version of the published application. ```PowerShell Install-NAVApp -ServerInstance $BcServerInstance -Name "Application" -Version $ExtVersion ``` -------------------------------- ### Install Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v14-v23 Installs a specific extension version on a tenant. ```PowerShell Install-NAVApp -ServerInstance -Name "" -Version -tenant ``` -------------------------------- ### Install Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-to-microsoft-base-app Installs the specified version of an extension to the target server instance. ```PowerShell Install-NAVApp -ServerInstance -Name "" -Version ``` -------------------------------- ### Example Request for shipmentMethods Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_shipmentmethod_get A concrete example of the GET request URL. ```json GET https://{businesscentralPrefix}/api/v1.0/companies({id})/shipmentMethods({id}) ``` -------------------------------- ### Init Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.finance.vat.registration.alt.-cust.-vat.-reg.-facade Initializes the VAT registration setup for a sales header. ```AL procedure Init(var SalesHeader: Record "Sales Header", xSalesHeader: Record "Sales Header") ``` -------------------------------- ### Install the base application extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v14-v15 Finalizes the installation of the base application extension on the tenant. ```powershell Install-NAVApp -ServerInstance -Name "Base Application" -Version ``` -------------------------------- ### Install Base Application Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v16-v17 Installs the Base Application extension using the Install-NAVApp cmdlet. ```PowerShell Install-NAVApp -ServerInstance -Name "Base Application" -Version ``` -------------------------------- ### Install Application Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v16-v17 Installs the Application extension using the Install-NAVApp cmdlet. ```PowerShell Install-NAVApp -ServerInstance -Name "Application" -Version ``` -------------------------------- ### SetupEmail Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/o365-setup-email Initializes the email setup process. The ForceSetup parameter determines whether to override existing configurations. ```AL procedure SetupEmail(ForceSetup: Boolean) ``` -------------------------------- ### Example Request for salesInvoices Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salesinvoice_get A concrete example of the GET request URL. ```HTTP GET https://{businesscentralPrefix}/api/v2.0/companies({id})/salesInvoices({id}) ``` -------------------------------- ### StartSession Usage Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/session/session-startsession-integer-integer-string-table-method An example demonstrating how to start a background session using a custom codeunit and a record. ```AL var CacheStressTestRec: Record Customer; SessionID: Integer; OK: Boolean; begin OK := StartSession(SessionId, CodeUnit::"Cache Stress Test", CompanyName, CacheStressTestRec); if OK then StopSession(SessionId, 'Logoff cache stress test session') else Error('The session was not started successfully.'); end; ``` -------------------------------- ### Example Request for purchaseInvoices Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_purchaseinvoice_get A concrete example of the GET request URL. ```JSON GET https://{businesscentralPrefix}/api/v2.0/companies({id})/purchaseInvoices({id}) ``` -------------------------------- ### Example Request for purchaseCreditMemoLines Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_purchasecreditmemoline_get A concrete example of the GET request URL. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/purchaseCreditMemoLines({id}) ``` -------------------------------- ### GetSetupRecord Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/interface/microsoft.sales.reminder.reminder-action Retrieves the setup record details. ```APIDOC ## procedure GetSetupRecord(var TableID: Integer, var RecordSystemId: Guid) ### Parameters - **TableID** (Integer) - Required - **RecordSystemId** (Guid) - Required ``` -------------------------------- ### Install Extensions Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v19-to-v21 Installs an extension on a single-tenant environment using the specified version. ```PowerShell Install-NAVApp -ServerInstance $NewBcServerInstance -Name " -Tenant $TenantId -Version $OldVersion ``` -------------------------------- ### Implement Navigation Actions for Assisted Setup Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-designing-navigate-pages Defines the Back, Next, and Finish actions in the footer and the logic to handle step transitions. ```AL actions { area(Processing) { action(Back) { Enabled = BackEnable; InFooterBar = true; Image = PreviousRecord; trigger OnAction() begin NextStep(true); end; } action(Next) { Enabled = NextEnable; InFooterBar = true; Image = NextRecord; trigger OnAction() begin NextStep(false); end; } action(Finish) { Enabled = FinishEnable; InFooterBar = true; Image = Approve; trigger OnAction() begin Finished(); end; } } } var BackEnable: Boolean; NextEnable: Boolean; FinishEnable: Boolean; local procedure NextStep(Backwards: Boolean) begin if Backwards then Step := Step - 1 else Step := Step + 1; EnableControls(); end; local procedure Finished() begin StoreRecordVar(); CurrPage.Close(); end; ``` -------------------------------- ### Example Request for paymentTerms Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_paymentterm_get A concrete example of the GET request URL. ```json GET https://{businesscentralPrefix}/api/v2.0/companies({id})/paymentTerms({id}) ``` -------------------------------- ### Install System Application Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v16-v17 Installs the System Application extension using the Install-NAVApp cmdlet. ```PowerShell Install-NAVApp -ServerInstance -Name "System Application" -Version ``` -------------------------------- ### Example Request for paymentMethods Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_paymentmethod_get A concrete example of the GET request URL. ```json GET https://{businesscentralPrefix}/api/v1.0/companies({id})/paymentMethods({id}) ``` -------------------------------- ### GetBuildVersion Example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/cside/cside-command-prompt An example of running the GetBuildVersion command with specified output and log file paths. ```text finsql.exe command=getbuildversion,file=C:\temp\navbuildversion.txt,logfile= C:\temp\bcbuildversionlog.txt ``` -------------------------------- ### Example Request for jobQueueEntries Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_jobqueueentry_get A concrete example of the GET request URL. ```JSON GET https://{businesscentralPrefix}/api/v2.0/companies({id})/jobQueueEntries({id}) ``` -------------------------------- ### ShowSetupForm Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.finance.generalledger.account.calc.-g-l-acc.-where-used Displays the setup form for the specified G/L account where-used record. ```AL procedure ShowSetupForm(GLAccWhereUsed: Record "G/L Account Where-Used") ``` -------------------------------- ### Install Microsoft.Identity.Client via NuGet Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/walkthrough-authenticate-web-services-using-oauth Use this command in the Package Manager Console to install the necessary library for OAuth token acquisition. ```PowerShell Install-Package Microsoft.Identity.Client -Version 4.40.0 ``` -------------------------------- ### Example Request for fixedAssets Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_fixedasset_get A concrete example of the GET request URL. ```http GET https://{businesscentralPrefix}/api/v2.0/companies({id})/fixedAssets({id}) ``` -------------------------------- ### GetHelpCodeForEmptyPostingSetupAccount Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.utilities.forward-link-mgt. Retrieves the help code for empty posting setup accounts. ```AL procedure GetHelpCodeForEmptyPostingSetupAccount(): Code[30] ``` -------------------------------- ### Install Extensions Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-to-microsoft-base-app-v17 Installs a specific version of an extension on the target server instance. ```PowerShell Install-NAVApp -ServerInstance -Name "" -Version ``` -------------------------------- ### Example Request for disputeStatus Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_disputestatus_get A concrete example of the GET request URL. ```json GET https://{businesscentralPrefix}/api/v2.0/companies({id})/disputeStatus({id}) ``` -------------------------------- ### Setup and Create Cash Flow Accounts Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.cashflow.forecast.cash-flow-management Methods to initialize cash flow settings and create new cash flow accounts. ```AL procedure SetupCashFlow(LiquidFundsGLAccountFilter: Code[250]) ``` ```AL procedure CreateCashFlowAccount(SourceType: Enum "Cash Flow Source Type", LiquidFundsGLAccountFilter: Code[250]) ``` -------------------------------- ### Install Microsoft_Application extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrading-cumulative-update-v15 Installs the Microsoft_Application extension on the specified tenant. ```PowerShell Install-NAVApp -ServerInstance -Tenant -Name Application ``` -------------------------------- ### Example Request for Companies Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_company_get A concrete example of the GET request URL. ```JSON GET https://{businesscentralPrefix}/api/v2.0/companies ``` -------------------------------- ### Setup Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/interface/microsoft.sales.reminder.reminder-action Performs setup operations for the reminder action. ```APIDOC ## procedure Setup() ``` -------------------------------- ### Install new extensions Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-publish-extensions Install newly published local functionality extensions on the specified tenant. ```PowerShell Install-NAVApp -ServerInstance -Name -Version ``` -------------------------------- ### FindSetup Method Source: https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.pricing.calculation.price-calculation-dtld.-setup Retrieves the detailed price calculation setup record. ```AL procedure FindSetup(var DtldPriceCalcSetup: Record "Dtld. Price Calculation Setup"): Boolean ``` -------------------------------- ### Control add-in path example Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-technical-upgrade-v14-v15 Example file path for importing a Business Chart control add-in zip file. ```text C:\Program Files\Microsoft Dynamics 365 Business Central\150\Service\Add-ins\BusinessChart\Microsoft.Dynamics.Nav.Client.BusinessChart.zip ``` -------------------------------- ### POST /Microsoft.NAV.completeSetup Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/cloudmigrationapi/cloud-migration-api-overview Finalizes the cloud migration setup process. ```APIDOC ## POST /companies({companyId})/setupCloudMigration({SetupRecordId})/Microsoft.NAV.completeSetup ### Description Completes the setup process for both SQL and Azure SQL hosted databases. ### Method POST ### Endpoint https://api.businesscentral.dynamics.com/v2.0/{aadTenantID}/{environment name}/api/microsoft/cloudMigration/v1.0/companies({companyId})/setupCloudMigration({SetupRecordId})/Microsoft.NAV.completeSetup ``` -------------------------------- ### Example Request for itemReceivedNotInvoicedPurchaseLines Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-analytics/api/dynamics_itemreceivednotinvoicedpurchaseline_get A concrete example of the GET request URL. ```http GET https://{businesscentralPrefix}/api/microsoft/analytics/v1.0/companies({companyId})/itemReceivedNotInvoicedPurchaseLines ``` -------------------------------- ### Get help for Set-ObjectPropertiesFromMenuSuite Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-pages-report-for-search Retrieve full documentation and parameter details for the cmdlet. ```powershell get-help Set-ObjectPropertiesFromMenuSuite -full ``` -------------------------------- ### Install Business Foundation Extension Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-unmodified-application-to-v27 Installs the Business Foundation extension, a prerequisite for upgrading the Base Application. ```PowerShell Install-NAVApp -ServerInstance $NewBcServerInstance -Name "Business Foundation" -Version $NewBCVersion ``` -------------------------------- ### Local server launch.json configuration Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-json-launch-file Example configuration for connecting to an on-premises Business Central instance. ```json { "name": "Publish: Your own server", // maybe change the configuration name "type": "al", "request": "launch", "environmentType": "OnPrem", "server": "http://bcserver", // change this to point to your instance URI "serverInstance": "BC", // change this to point to your instance "authentication": "UserPassword", // change this to your auth setup "startupObjectId": 22, // change this to your choice of startup object "breakOnError": "All", "breakOnRecordWrite": "None", "launchBrowser": true, "enableSqlInformationDebugger": true, "enableLongRunningSqlStatements": true, "longRunningSqlStatementsThreshold": 500, "numberOfSqlStatements": 10, "tenant": "default", // change this to point to your tenant "usePublicURLFromServer": true } ``` -------------------------------- ### Example Request for inventoryProdOrderComponentLines Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-analytics/api/dynamics_inventoryprodordercomponentline_get A concrete example of the GET request URL. ```json GET https://{businesscentralPrefix}/api/microsoft/analytics/v1.0/companies({companyId})/inventoryProdOrderComponentLines ``` -------------------------------- ### Example Request for closingGeneralLedgerEntries Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-analytics/api/dynamics_closinggeneralledgerentry_get A concrete example of the GET request URL. ```JSON GET https://{businesscentralPrefix}/api/microsoft/analytics/v1.0/companies({companyId})/closingGeneralLedgerEntries ```