Using AL Table Proxy Generator Tool to create Power Apps Table in Business Central

Abhishek sirsolkar
3 min readNov 27, 2023

--

The AL Table Proxy Generator tool, altpgen.exe, is in the corresponding subdirectory and is part of the AL Language extension. [C:\Users\abhishek.sirsolkar\.vscode\extensions\ms-dynamics-smb.al-12.1.887908\bin]

After copying the corresponding folder path, run “Windows PowerShell” as administrator. After that, change the corresponding folder path using the “cd” command.

Before creating a command Go to https://make.powerapps.com/, choose Solution -> Table, and then copy the table name.

Run this command in the Windows PowerShell.

.\altpgen -project:"C:\Users\Document\ALProject\BC_CRM_Integration" -packagecachepath:"C:\Users\Document\ALProject\BC_CRM_Integration\.alpackages" -serviceuri:"https://xxxxxxxxxxx.crm8.dynamics.com/" -entities:demo_bccrmdemo -baseid:73910 -tabletype:CRM

Where,

-project: Where app.json is located within the BC custom extension.

-packagecachepath: Where “.alpackages” is located within the BC custom extension.

-serviceuri: CRM’s environment link.

-entities: Name of table from CRM solution.

-baseid: Which ID do you want to use to begin creating tables in the BC Extension

-tabletype: CRM or CDS

If this error occurs when you run this command, download and install the Dotnet SDK file from https://dotnet.microsoft.com/en-us/download here. Dotnet-Sdk-6.0.413-Win-X64 is the file I use.

You must use your CRM credentials to log in after executing the command. Once successfully logged in, “1 files written” appears in Windows PowerShell.

Proceed to the BC Custom Extension and confirm that the AL Table Proxy Generator tool has created the table and its columns automatically.

Create a page to correspond to the automatically generated table, and then add the trigger given below to fetch data from the CRM Environment.

trigger OnInit()
begin
CODEUNIT.Run(CODEUNIT::"CRM Integration Management");
Commit();
end;

--

--