### Example Application Install Status Response Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/admin/programmability-tutorial-install-application-environment.md This is an example JSON output representing the status of an application installation operation. It includes fields like 'status', 'createdDateTime', and 'operationId'. ```json { "status": "NotStarted", "createdDateTime": "2022-03-22T20:05:58.9414573Z", "lastActionDateTime": null, "error": null, "statusMessage": null, "operationId": "523b51a8-6af4-40cd-aa7d-86bddfa6697b" } ``` -------------------------------- ### Install Catalog Item Example (C#) Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/catalog/install-items.md Provides a C# example for installing a catalog item using the mspcat_InstallCatalogItemRequest. It includes validation for the target record type and optional settings and package ID. ```csharp /// /// Demonstrates how to install a catalog item in Power Platform. /// /// The authenticated IOrganizationService instance. /// Reference to the catalog item to install /// The URL of the environment to install the item in. /// The settings to apply (optional) /// The packageId to apply (optional) /// A reference to the install history so you can check the status static EntityReference InstallCatalogItemExample(IOrganizationService service, EntityReference target, Uri deployToOrgUrl, string? settings = null, Guid? packageId = null) { if (target.LogicalName != "mspcat_applications") { throw new Exception("target parameter must be a reference to a Catalog Item (mspcat_applications) record"); } var request = new mspcat_InstallCatalogItemRequest { Target = target, DeployToOrganizationUrl = deployToOrgUrl.ToString(), }; if (packageId.HasValue) { request.PackageId = packageId.Value; } if (string.IsNullOrEmpty(settings)) { request.Settings = settings; } var response = (mspcat_InstallCatalogItemResponse)service.Execute(request); return response.InstallHistoryReferance; } ``` -------------------------------- ### Install Catalog Item by CID Example (C#) Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/catalog/install-items.md Shows how to use the static InstallCatalogItemByCIDExample method to install a catalog item. Requires an authenticated IOrganizationService instance. ```csharp EntityReference installHistoryReference = InstallCatalogItemByCIDExample( service: service, catalogItemId: "MyCatalogItem@1.0.0.0", deployToOrgUrl: new Uri("https://.crm.dynamics.com/")); Console.WriteLine(installHistoryReference.Id); ``` -------------------------------- ### Install Application API Response Example Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/admin/programmability-tutorial-install-application-environment.md This is an example of a successful response from the Install application API, indicating the installation request has been processed. The 'operationId' is crucial for tracking the installation status in subsequent steps. ```json { "id": "9a44d33b-6055-4c9b-aa4a-4c410a22e9ad", "packageId": "ce3bab3c-ada1-40cf-b84b-49b26603a281", "applicationId": "2f17f077-4175-4d82-b82b-17cd8950b74f", "applicationName": "Office365Groups", "applicationDescription": "", "singlePageApplicationUrl": "", "publisherName": "Microsoft CRM Package", "publisherId": "255953fd-9ab8-4146-bfa1-859aae326ae9", "packageUniqueName": "Office365Groups", "packageVersion": "2.9.0.3", "localizedDescription": "With Office 365 groups, you can collaborate with people across your company even if they aren’t Dynamics 365 users. Groups provide a single location to share conversations, meetings, documents, and more.", "localizedName": "Office 365 Groups", "learnMoreUrl": "http://go.microsoft.com/fwlink/?LinkID=525719", "termsOfServiceBlobUris": [ "https://crmprodnam.blob.core.windows.net/preferredsolution/microsoft_tos_dbd53f75-b571-46ad-b9ce-21b5656b85dd_1?sv=2018-03-28&sr=c&sig=v5iBtDum0N6A0sqyyhIkPECibmpGOKGiSmmm3ALGIR0%3D&se=2022-03-23T19%3A35%3A59Z&sp=r" ], "applicationVisibility": "All", "lastOperation": { "state": "InstallRequested", "createdOn": "2022-03-22T19:35:59.7425066Z", "modifiedOn": null, "errorDetails": null, "statusMessage": null, "instancePackageId": "9a44d33b-6055-4c9b-aa4a-4c410a22e9ad", "operationId": "4fde996a-bf68-413c-b2bf-33f21a7e9afb" }, "customHandleUpgrade": false } ``` -------------------------------- ### Markdown Example for Welcome Content Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/admin/welcome-content.md This example demonstrates how to format welcome content using Markdown. It includes an image, headings, and a numbered list with links. Refer to the Markdown guide for more details. ```markdown ![Contoso](https://i.ibb.co/SNSTCx3/something.png) ## Welcome to Contoso Power Apps ### Let's get started with data Before you start using Power Apps, please refer to our company guidance 1. **Get trained:** [Learning Videos]() and [training guides]() 2. **Contribute ideas:** Submit an idea for a new app or flow idea at [Suggestion box]() 3. **Learn from others:** [Top tips]() by expert makers at Contoso ``` -------------------------------- ### Get managed identity information Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/managed-identity-get-intro.md Use this command to retrieve details about the managed identity associated with your Power Platform environment. No additional setup is required beyond having the Power Platform CLI installed. ```powershell pac managed-identity get ``` -------------------------------- ### ALM Accelerator Install Configuration File Example Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/coe/cli/alm/admin-install.md This is an example of the JSON configuration file generated for the ALM Accelerator installation. It specifies settings for environments, service principals, and Azure DevOps integration. ```json { "log": [ "info" ], "components": [ "all" ], "aad": "ALMAcceleratorServicePrincipal", "group": "ALMAcceleratorForAdvancedMakers", "devOpsOrganization": "https://dev.azure.com/dev1234", "project": "alm-sandbox", "repository": "pipelines", "settings": { "installEnvironments": [ "validation", "test", "prod" ], "validation": "https://sample-validation.crm.dynamics.com", "test": "https://sample-test.crm.dynamics.com", "prod": "https://sample-prod.crm.dynamics.com", "createSecret": "true", "region": [ "NAM" ] }, "importMethod": "api", "endpoint": "prod" } ``` -------------------------------- ### Import CoE Starter Kit Solution Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/coe/before-setup-gov.md Instructions for importing the CenterOfExcellenceAuditComponents_x_x_x_xx_managed.zip solution file into a production environment. Leave all environment variables blank during import. ```Power Automate CenterOfExcellenceAuditComponents_x_x_x_xx_managed.zip ``` -------------------------------- ### Create an app with description, add to solution, and publish Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/model-create-remarks.md This command creates a model-driven app with a name and description, adds it to a specified solution, and immediately publishes it. ```bash pac model create \ --name "Contoso Sales Hub" \ --description "Central hub for managing Contoso sales activities, accounts, and contacts." \ --solution "ContosoSales" \ --publish ``` -------------------------------- ### GUID Data Type Examples Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/power-fx/data-types.md Generates or represents globally unique identifiers. Use GUID() for a new GUID or GUID("...") for a specific one. ```Power Fx GUID() ``` ```Power Fx GUID( "123e4567-e89b-12d3-a456-426655440000" ) ``` -------------------------------- ### Deployment Settings File Example Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/alm/conn-ref-env-variables-build-tools.md This JSON file contains the necessary information for environment variables and connection references to be used in Power Platform build tools for solution deployment. ```json { "EnvironmentVariables": [ { "SchemaName": "tst_Deployment_env", "Value": "Test" }, { "SchemaName": "tst_EnvironmentType", "Value": "UAT" } ], "ConnectionReferences": [ { "LogicalName": "tst_sharedtst5fcreateuserandjob5ffeb85c4c63870282_b4cc7", "ConnectionId": "4445162937b84457a3465d2f0c2cab7e", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_tst-5fcreateuserandjob-5ff805fab2693f57dc" }, { "LogicalName": "tst_SharepointSiteURL", "ConnectionId": "ef3d1cbb2c3b4e7987e02486584689d3", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline" }, { "LogicalName": "tst_AzureDevopsConnRef", "ConnectionId": "74e578ccc24846729f32fcee83b630de", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_visualstudioteamservices" }, { "LogicalName": "tst_GHConn", "ConnectionId": "d8beb0fb533442c6aee5c18ae164f13d", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_github" } ] } ``` -------------------------------- ### Reusable E2E Setup Step Template Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/playwright-samples/cicd.md This YAML template defines the setup steps for Playwright tests in Azure Pipelines. It installs Node.js, Rush dependencies, builds the toolkit, and installs Playwright browsers. ```yaml steps: - task: NodeTool@0 displayName: Install Node.js inputs: versionSpec: $(NODE_VERSION) - task: Bash@3 displayName: Install Rush dependencies script: node common/scripts/install-run-rush.js install - task: Bash@3 displayName: Build toolkit script: node common/scripts/install-run-rush.js build --to power-platform-playwright-toolkit - task: Bash@3 displayName: Install Playwright browsers script: | cd packages/e2e-tests npx playwright install chromium --with-deps ``` -------------------------------- ### Authenticate and install CoE CLI components Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/coe/cli/overview.md Demonstrates the authentication process using Azure CLI and then installing CoE CLI components. Includes signing in and out of Azure. ```bash az login coe alm install -c aad az logout ``` -------------------------------- ### Get all installed PowerShell modules Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/admin/powerapps-powershell.md Retrieves a list of all installed PowerShell modules on the system. Useful for checking module versions. ```powershell Get-Module ``` -------------------------------- ### Create an app in a specific environment with URL Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/model-create-remarks.md Create a model-driven app in a specific Power Platform environment by providing the environment's URL, along with its name, description, solution, and publish options. ```bash pac model create \ --name "Contoso Sales Hub" \ --description "Central hub for managing Contoso sales activities, accounts, and contacts." \ --environment "https://contoso.crm.dynamics.com" \ --solution "ContosoSales" \ --publish ``` -------------------------------- ### SubwayNav OnSelect/OnChange Example Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/creator-kit/subwaynav.md Example code to get the selected step and its status using the OnSelect or OnChange property of the SubwayNav control. ```power-fx Notify( Concatenate(Self.Selected.ItemLabel, " selected and its status is ", Self.Selected.ItemState )); ``` -------------------------------- ### Install Catalog Item using SDK for .NET (mspcat_InstallCatalogItemByCID) Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/catalog/install-items.md This C# method demonstrates how to install a catalog item using the 'mspcat_InstallCatalogItemByCID' message. It requires an authenticated IOrganizationService instance and accepts the catalog item ID (optionally with version) and the target environment URL. ```csharp /// /// Demonstrates how to install a catalog item in Power Platform. /// /// The authenticated IOrganizationService instance. /// The mspcat_TPSID value of the catalog item, optionally with @version /// The URL of the environment to install the item in. /// The settings to apply (optional) /// A reference to the install history so you can check the status static EntityReference InstallCatalogItemByCIDExample(IOrganizationService service, string catalogItemId, Uri deployToOrgUrl, string? settings = null) { var request = new mspcat_InstallCatalogItemByCIDRequest { CID = catalogItemId, DeployToOrganizationUrl = deployToOrgUrl.ToString(), }; if (string.IsNullOrEmpty(settings)) { request.Settings = settings; } var response = (mspcat_InstallCatalogItemByCIDResponse)service.Execute(request); return response.InstallHistoryReferance; } ``` -------------------------------- ### Create a simple sandbox environment Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/admin-create-intro.md Creates a sandbox environment with default settings for currency, language, and region. Use this for basic environment provisioning. ```powershell pac admin create ` --name "Contoso Test" ` --type Sandbox ` --domain ContosoTest ``` -------------------------------- ### Generate GUID in Behavior Formula Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/power-fx/reference/function-guid.md When used in a behavior formula, the GUID function is evaluated each time the formula is executed. This example shows generating a new GUID each time the text input changes. ```power-fx TextInput1.Text & " " & GUID() ``` -------------------------------- ### ALM Accelerator Install Configuration Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/coe/cli/alm/overview.md Example JSON configuration file for the ALM accelerator installation. This file defines various settings for deployment. ```json { "log": [ "info" ], "components": [ "all" ], "aad": "ALMAcceleratorServicePrincipal", "group": "ALMAcceleratorForMakers", "devOpsOrganization": "https://dev.azure.com/contoso", "project": "alm-sandbox", "repository": "alm-sandbox", "pipelineRepository": "coe-alm-accelerator-templates", "environments": "https://contoso-prod.crm.dynamics.com/", "settings": { "installEnvironments": [ "validation", "test", "prod" ], "validation": "https://contoso-validation.crm.dynamics.com/", "test": "https://contoso-test.crm.dynamics.com/", "prod": "https://contoso-prod.crm.dynamics.com/", "createSecret": "true", "region": [ "NAM" ] }, "importMethod": "api", "endpoint": "prod", "$schema": "./alm.schema.json" } ``` -------------------------------- ### Set Status Field with GUID in Patch Function Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/power-fx/reference/function-guid.md This example demonstrates how to use the GUID function within the Patch function to set a specific GUID value for the 'Status' field of a new database record. ```power-fx Patch( Products, Default( Products ), { Status: GUID( "F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4" ) } ) ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/playwright-samples/get-started.md Copy the example environment file and populate it with your specific Power Platform environment details, app URLs, and authentication credentials. ```bash cp .env.example .env ``` ```ini # Power Apps POWER_APPS_BASE_URL=https://make.powerapps.com POWER_APPS_ENVIRONMENT_ID= # Model-driven app (for model-driven app tests) MODEL_DRIVEN_APP_URL=https://.crm.dynamics.com/main.aspx?appid= # Canvas app (for canvas tests) CANVAS_APP_ID= CANVAS_APP_TENANT_ID= # Authentication MS_AUTH_EMAIL= MS_AUTH_CREDENTIAL_TYPE=password MS_USER_PASSWORD= ``` -------------------------------- ### Start MCP Server with dnx command Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/howto/use-mcp.md Alternatively, start the MCP server using the .NET dnx command without needing to install the PAC CLI. ```dotnetcli dnx Microsoft.PowerApps.CLI.Tool --yes copilot mcp --run ``` -------------------------------- ### Deployment Settings JSON Example Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/alm-accelerator/setup-data-deployment-configuration.md This JSON file configures environment variables and connection references for solution deployments. Use pipeline variables or environment-specific files for dynamic values. ```json { "EnvironmentVariables": [ { "SchemaName": "cat_shared_sharepointonline_97456712308a4e65aae18bafcd84c81f", "Value": "#{environmentvariable.cat_shared_sharepointonline_97456712308a4e65aae18bafcd84c81f}#" }, { "SchemaName": "cat_shared_sharepointonline_21f63b2d26f043fb85a5c32fc0c65924", "Value": "#{environmentvariable.cat_shared_sharepointonline_21f63b2d26f043fb85a5c32fc0c65924}#" }, { "SchemaName": "cat_TextEnvironmentVariable", "Value": "#{environmentvariable.cat_TextEnvironmentVariable}#" }, { "SchemaName": "cat_ConnectorBaseUrl", "Value": "#{environmentvariable.cat_ConnectorBaseUrl}#" }, { "SchemaName": "cat_DecimalEnvironmentVariable", "Value": "#{environmentvariable.cat_DecimalEnvironmentVariable}#" }, { "SchemaName": "cat_JsonEnvironmentVariable", "Value": "#{environmentvariable.cat_JsonEnvironmentVariable}#" }, { "SchemaName": "cat_ConnectorHostUrl", "Value": "#{environmentvariable.cat_ConnectorHostUrl}#" } ], "ConnectionReferences": [ { "LogicalName": "new_sharedsharepointonline_b49bb", "ConnectionId": "#{connectionreference.new_sharedsharepointonline_b49bb}#", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline" }, { "LogicalName": "cat_CDS_Current", "ConnectionId": "#{connectionreference.cat_CDS_Current}#", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps" } ] } ``` -------------------------------- ### Initialize a new Power Platform project Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/code-init-intro.md Use this command to start a new project. It sets up the necessary files and folder structure for Power Platform development. ```powershell pac code init ``` -------------------------------- ### pac catalog status Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/catalog.md Gets the status of a catalog install or submit request. ```APIDOC ## pac catalog status ### Description Get status of the catalog install/submit request. ### Parameters #### Required Parameters - **--tracking-id** `-id` (string) - Required - Request tracking ID. - **--type** `-t` (string) - Required - Request type. Use one of these values: `Install`, `Submit`. #### Optional Parameters - **--environment** `-env` (string) - Optional - Url or ID of the environment that has catalog installed. When not specified, the active organization selected for the current auth profile will be used. ``` -------------------------------- ### Generate CoE ALM Install Configuration for Data Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/coe/cli/alm/personas.md Generates a specific installation configuration file for data-related aspects of the CoE ALM Accelerator. Used by administrators for setup. ```bash coe alm generate install -o data.json ``` -------------------------------- ### Install Power Platform Tools and Export Solution Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/alm/devops-github-available-actions.md This snippet shows how to install Power Platform CLI tools and then export a solution. Ensure the 'actions-install' task is the first step before other Power Platform actions. ```yaml jobs: builds: runs-on: windows-latest # alternate runner OS is: ubuntu-latest steps: - name: Install Power Platform Tools uses: microsoft/powerplatform-actions/actions-install@v1 - name: Export Solution uses: microsoft/powerplatform-actions/export-solution@v1 with: environment-url: 'https://myenv.crm.dynamics.com' user-name: 'me@myenv.onmicrosoft.com' password-secret: ${{ secrets.MYPASSWORD }} solution-name: aSolution solution-output-file: 'aSolution.zip' working-directory: 'out' ``` -------------------------------- ### Download and Launch Plug-in Registration Tool Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/tool-prt-intro.md This command downloads the Plug-in Registration Tool if it's not already present, and then launches it. Subsequent runs will directly launch the tool. ```powershell pac tool prt ``` -------------------------------- ### Example Deployment Settings File Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/alm/conn-ref-env-variables-build-tools.md This JSON file stores environment variable and connection reference configurations for automated deployments. Values for ConnectionId and ConnectorId need to be populated based on the target environment. ```json { "EnvironmentVariables": [ { "SchemaName": "tst_Deployment_env", "Value": "" }, { "SchemaName": "tst_EnvironmentType", "Value": "" } ], "ConnectionReferences": [ { "LogicalName": "tst_sharedtst5fcreateuserandjob5ffeb85c4c63870282_b4cc7", "ConnectionId": "", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_tst-5fcreateuserandjob-5ff805fab2693f57dc" }, { "LogicalName": "tst_SharepointSiteURL", "ConnectionId": "", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline" }, { "LogicalName": "tst_AzureDevopsConnRef", "ConnectionId": "", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_visualstudioteamservices" }, { "LogicalName": "tst_GHConn", "ConnectionId": "", "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_github" } ] } ``` -------------------------------- ### Install AA4PP Solution Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/coe/cli/alm/personas.md Installs the AA4PP managed solution using a previously generated configuration file. This command automates the setup of Azure DevOps resources and Power Platform environments. ```bash coe alm install -f install.json ``` -------------------------------- ### Initialize a new solution project Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/alm/component-framework.md Use this command to create a new solution project for bundling code components. Ensure publisher name and prefix are unique to your environment. ```dotnetcli pac solution init --publisher-name --publisher-prefix ``` -------------------------------- ### Get Help for a Cmdlet Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/admin/powerapps-powershell.md Use Get-Help with a CmdletName to retrieve detailed information and examples for a specific cmdlet. ```powershell Get-Help Get-AdminPowerAppEnvironment ``` ```powershell Get-Help Get-AdminPowerAppEnvironment -Examples ``` ```powershell Get-Help Get-AdminPowerAppEnvironment -Detailed ``` -------------------------------- ### Example Plan Definition File Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/solution-add-license-intro.md This CSV file defines the available license plans for your solution, including their service IDs, display names, and more info URLs. ```csv ServiceID,Display name,More info URL test_isvconnect1599092224747.d365_isvconnect_prod_licensable.bronzeplan,Fabrikam Bronze Plan,http://www.microsoft.com test_isvconnect1599092224747.d365_isvconnect_prod_licensable.silverplan,Fabrikam Silver Plan,http://www.microsoft.com test_isvconnect1599092224747.d365_isvconnect_prod_licensable.goldplan,Fabrikam Gold Plan,http://www.microsoft.com ``` -------------------------------- ### Get detailed help for a specific CoE CLI command Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/guidance/coe/cli/overview.md Use the --help argument to get a short description of any command, or the 'help' command for more detailed information on specific commands like 'alm install'. ```bash coe help alm install ``` -------------------------------- ### Launch Configuration Migration Tool Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/tool-cmt-intro.md This command downloads and launches the Configuration Migration tool. If it's already downloaded, it will launch directly. ```powershell pac tool cmt ``` -------------------------------- ### Finance and Operations Unit Test Class Example Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/unified-experience/finance-operations-testing.md Example of a test class using the SysTest Framework. Includes a setup method for test data and two test methods marked with SysTestMethod and Hookable(false). ```xpp class FMUnitTestSample extends SysTestCase { public void setup() { // Reset the test data to be sure things are clean FMDataHelper::main(null); } [SysTestMethod, Hookable(false)] public void testFMTotalsEngine() { FMRental rental; FMTotalsEngine fmTotals; FMRentalTotal fmRentalTotal; FMRentalCharge rentalCharge; FMRentalTotal expectedtotal; str rentalID = '000022'; // Find a known rental rental = FMRental::find(rentalID); // Get the rental charges associated with the rental // Data is seeded randomly, so this will change for each run select sum(ExtendedAmount) from rentalCharge where rentalCharge.RentalId == rental.RentalId; fmTotals = FMTotalsEngine::construct(); fmTotals.calculateRentalVehicleRate(rental); // Get the totals from the engine fmRentalTotal = fmTotals.totals(rental); // Set the expected amount expectedTotal = rental.VehicleRateTotal + rentalCharge.ExtendedAmount; this.assertEquals(expectedTotal,fmRentalTotal); } [SysTestMethod, Hookable(false)] public void testFMCarValidateField() { FMCarClass fmCar; fmCar.NumberOfDoors = -1; this.assertFalse(fmCar.validateField(Fieldnum("FMCarClass", "NumberOfDoors"))); fmCar.NumberOfDoors = 4; this.assertTrue(fmCar.validateField(Fieldnum("FMCarClass", "NumberOfDoors"))); } } ``` -------------------------------- ### Initialize a new plugin project Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/plugin-init-intro.md Use this command to create the basic file structure and configuration for a new Power Platform plugin project. ```powershell pac plugin init ``` -------------------------------- ### Initiate Data Import Source: https://github.com/microsoftdocs/power-platform/blob/main/power-platform/developer/cli/reference/includes/data-import-intro.md Use this command to start a data import process. Ensure the Power Platform CLI is installed and authenticated. ```powershell pac data import ```