Customizing Dynamics 365 Business Central with Cursor | The AI-first Code Editor (without VS Code)

Dynamics 365 Business Central

Hi, Readers.
As you might know, to start writing extensions for Dynamics 365 Business Central, you’ll need a Business Central tenant, Visual Studio Code, and the AL Language extension for Microsoft Dynamics 365 Business Central. Visual Studio Code is a cross-platform editor that you’ll use for coding and debugging. More details: Get started with AL

We have also discussed Github Copilot.

Today I would like to talk about the recently popular new code editor, Cursor.
Cursor is an AI-powered code editor that helps you build software faster.

The following information is extracted from the official website.

Features:
It’s early days, but right now Cursor can help you with a few things…

  • Chat: Talk with a bot that understands your entire code base
  • Edit: Ask the AI to change a block of code, see an inline diff of the edits
  • Debug: Hover over linter errors or stack traces to auto-fix them

See here for more info on Cursor’s features.

You may be wondering if Cursor can be used for Business Central customization. Let’s continue.

Download and install Cursor.

My test version:

Choose Continue. (You can keep your VS Code shortcut keys. And you can set the language used on the AI.)

Then there is the most convenient feature, we can migrate in one click from VS Code. Choose Use Extensions.

PS:
In VS Code extensions:

When migrating, it seems that the number will be larger than VS Code Extensions.

After the migration, in Cursor:

Users must register and log in to use. (I think this may hinder the number of users🧐)

To avoid abuse on our backend, we ask that you login to use the AI features

Currently, Microsoft account is not supported. You can sign up with a Github or Google account or use other email address.

For example, Continue with Github

After logging in, we finally opened Cursor.

# Getting started
Welcome to Cursor. Here are the basics:
* Highlight code. Hit Cmd+K to prompt an edit.
* Open chat by clicking the right-bar button (on the top-right).
  – Highlight code and hit Cmd+Shift+L to focus the AI on particular pieces of code
  – Try the “with codebase” button to ask about the entire repo
  – Use @ to import documentation
* Hover over a lint error. Click “Fix in chat.”
* Hover over a terminal error. Click “Auto-Debug”.
Try using Cursor to generate edits, spot bugs, find code, learn about docs, and explain code.
If you run into any trouble or have any feedback, feel free to reach out at hi@cursor.so.

The UI is similar to VS Code, with the menus concentrated at the top. There is a Chat window on the right, where you can directly use the AI chat function.

PS: Because I installed the Github Copilot extension in VS Code, it can also be used in Cursor, but it needs to be authenticated again.

Okay, let’s try writing extensions for Business Central in Cursor.

Run AL: Go! command, choose a path to a new empty folder and which version to run.

Then choose Microsoft cloud sandbox as the server.

Edit launch.json file.

Then run AL: Download symbols command.

Symbols have been downloaded. There’s no problem.

PS:

Finally try publishing.

Great.

Everything works the same as in VS Code, but it feels a little faster.
Test video:

Well, I only tested it for a short time, so I’m not sure there are any hidden problems. Please note that this is not the tool that Microsoft recommends for customizing Business Central. But if you don’t use the AI function, it’s not too different from VS Code, and I personally feel it’s faster than VS Code’s in terms of startup speed, app publishing speed, downloading Symbols, etc.
If you are also interested in Cursor, give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL