Giter Site home page Giter Site logo

microsoft / al Goto Github PK

View Code? Open in Web Editor NEW
705.0 167.0 243.0 8.85 MB

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.

License: MIT License

PowerShell 53.88% JavaScript 46.12%
al-language dynamics-365 visual-studio-code dynamics-365-business-central dynamics-365-bc

al's Introduction

Visual Studio Code AL Language extension for Microsoft Dynamics 365 Business Central

Welcome

The main purpose of this repository is to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central. In addition, you will find code samples to help you get started writing extensions in AL and get familiar with the tools.

Documentation

For documentation about using the AL Language to extend Dynamics 365 Business Central, read some of our topics on Microsoft Dynamics 365 Business Central docs:
Getting Started
Building Your First Sample Extension
Developer Reference

Bugs and feature requests

If you have encountered a bug or you have a feature request, please first read the contributing guidelines and then search for existing and closed issues.

Bugs pertaining to the AL compiler and the developer tools for the latest version can be filed in this repository. We will respond to these issues on a best-effort basis.

See the triage process document for more information on how we handle incoming requests.

Community

Our answers to frequently asked questions can be found in our FAQ. To get help from community members please use one of the following resources:

Related projects

The following repositories can provide additional resources depending on the issues that you are facing:

Contributing

Please read through our contributing guidelines.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

AL Developer Preview builds

To get access to the AL Developer Preview builds you need to be part of the Ready2Go program. Detailed instructions can be found at https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/readiness/get-started.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT license.

al's People

Contributors

achim-t avatar asgeirdt avatar atoader avatar dagirard avatar danielgoehler avatar defr0std avatar dependabot[bot] avatar eknraw avatar emildamsbo avatar esbenk avatar gallimathias avatar hougaard avatar johanstenberg100 avatar joseppages avatar kalberes avatar kaspermoerch avatar kine avatar mikeglue avatar niku-live avatar nndobrev avatar pborring avatar pedersenthomas avatar qutreson avatar sbalslev avatar susannewindfeldpedersen avatar thedoubleh avatar thloke avatar thpeder avatar waldo1001 avatar yrest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

al's Issues

TestField doesn't throw error message

NAV 2017 using Visual Studio Code

This Code is written in the Codeunit

In my Code
r: This a variable corresponding to a Record
Field1 : is a boolean field
Field2: is a text field

If r.Field1 then begin
r.TestField(r.Field2)
end;

The TestField doesn't throw an error

Syntax Documentation

IntelliSense is not helping much in the Syntax.

Besides the samples on "C:\DEMO\New Developer Experience\AL" (which are not complete), is there any way to get to the syntax decently in VSCode? Or hasn't this been implemented just yet?

Usage of virtual tables (virtual table names conflict with language keywords)

I don't know if this question has been asked before, but is it possible to use virtual tables in extensions?
When I try the following code the compiler gives an error:

codeunit 70000000 Test
{
    trigger OnRun();
    var 
        UserTable : Record User;
        VirtualFieldTable : Record Field;
        VirtualDateTable : Record Date;
        VirtualFileTable : Record File;
    begin
    end;
}

Compiler output:

Microsoft (R) AL Compiler version 10.0.6084
Copyright (C) Microsoft Corporation. All rights reserved

c:\Projects\Test\Test.al(6,36): error AL0107: Syntax error, identifier expected
c:\Projects\Test\Test.al(6,36): error AL0104: Syntax error, ';' expected
c:\Projects\Test\Test.al(6,36): error AL0104: Syntax error, 'begin' expected
c:\Projects\Test\Test.al(6,36): error AL0104: Syntax error, 'end' expected
c:\Projects\Test\Test.al(7,26): error AL0104: Syntax error, 'end' expected
c:\Projects\Test\Test.al(7,28): error AL0111: Semicolon expected
c:\Projects\Test\Test.al(7,35): error AL0111: Semicolon expected
c:\Projects\Test\Test.al(8,26): error AL0104: Syntax error, 'end' expected
c:\Projects\Test\Test.al(8,28): error AL0111: Semicolon expected
c:\Projects\Test\Test.al(8,35): error AL0111: Semicolon expected
c:\Projects\Test\Test.al(9,33): error AL0104: Syntax error, 'end' expected
c:\Projects\Test\Test.al(9,35): error AL0111: Semicolon expected
c:\Projects\Test\Test.al(9,42): error AL0111: Semicolon expected
c:\Projects\Test\Test.al(12,1): error AL0104: Syntax error, 'end' expected
c:\Projects\Test\Test.al(12,1): error AL0104: Syntax error, ';' expected
Error: The package could not be created.

Event Subscriber in AL Visual Studio code

Hi all,
What is the syntax of Event Subscriber in AL Visual studio code?
[EventSubscriber(ObjectType::Table, 99000763, OnAfterActionEvent,Release,SkipOnMissingLicense,SkipOnMissingPermission)]

Also for OnAfterInsertEvent I'm getting error.

It is giving me error that Invalid attribute argument syntax. Kindly suggest.
Thanks in advance.

Question: FunctionVisibility

Hi

What is the exact use of the property FunctionVisibility(External/Internal) in functions? What is the difference to Local(Yes/No)

No task runner configured when trying to build.

Created VM using http://aka.ms/navdeveloperpreview.

Logon to server and run Visual Studio Code from shortcut on desktop.

Open folder C:\Users\vmadmin\Documents\AL\Samples\HelloWorld

Press Ctr+Shift+B to build.

Get Info message: No task runner configured.

I see there is an option to configure a task runner but I have no idea which one I should select.

"Partial" objects

It would be nice to be able to split object definition between multiple files the same way as it can be done with partial classes in c#. It would allow us to separate page or table definition and code and design them visually in other editors (i.e. design page layout in web client and write code in vs code). It will also be possible to generate part of the objects from another file format (i.e. WSDL), add additional functions manually to them and regenerate code later, when that source file changes without losing our manual modifications.

Obviously to fully separate page layout from code, trigger properties of controls would have to contain function names instead of code.

some Action Groups not showing

I would like to add new action in Process group but it is not showing under addlast() function.
what is the reason? same with manage and reports.
other groups like Prices and WIP are showing.
issue

SETSELECTIONFILTER still not possible?

Hi,

I was assuming that I would be able to use SETSELECTIONFILTER, but it appears I can't. I get the error:

[2017-01-17 10:31:36.09] Error: The request failed with code 500, reason: c:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Server\MicrosoftDynamicsNavServer$Navision_main\source\PageExtension\PageExtension70066090.cs(130,17) : error CS0012: The type 'Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.IEntityBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Azure.ActiveDirectory.GraphClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. c:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Server\MicrosoftDynamicsNavServer$Navision_main\source\PageExtension\PageExtension70066090.cs(130,38) : error CS1061: 'Microsoft.Dynamics.Nav.BusinessApplication.PageExtension70066090' does not contain a definition for 'SetSelectionFilter' and no extension method 'SetSelectionFilter' accepting a first argument of type 'Microsoft.Dynamics.Nav.BusinessApplication.PageExtension70066090' could be found (are you missing a using directive or an assembly reference?)

I noticed there is a "CurrPage.SetSelection(Item)" as well, and that does compile and publish. But when I execute the new action, I get this error:

Function ID 1 was called. The object with ID 0 does not have a member with that ID.

Menusuite

Can we add new pages to Menusuite using present visual studio code?

TESTFIELD

Hi

I'm working on VS Code in NAV. I need to know the syntax how to use TESTFIELD in VS code ?

How can i define global variables and trigger on a page

Hi everyone,
i checked the given examples to solve this problem described above. I only foud how to add global variables on a codeunit. If i try to go the same way on a page i get confusing error messages.
grafik

Thanks for any help in advance.

"logo" in app.json

Hi
Is is supportet to use the logo property in the app.json file yet? Where do I have to put the image file into?
I tried to put it in the source folder and just userd the file name. But i try to publish the extension it hangs somehow.

image

This is the compiler output
image

It seems it hangs while it compiles the code. It never starts the publishing process

When I remove the icon property it works fine again.

Publish Events

Can you briefly share on how to publish to an event? I found how to subscribe to it (there is even a snippet) .. and expecting quite the same for publisher, but I couldn't figure out how.. . ("EventPublisher" is not a valid attribute).

EventSubscriber

Hey,

IntelliSense does not suggest anything usefull when completing the EventSubscriber Syntax.

I'd like some more information on how to form the [EventSubscriber] syntax.
We get [EventSubscriber(ObjectType::ObjectType, ObjectId, OnSomeEvent, ElementName, SkipOnMissingLicense, SkipOnMissingPermission)].
However, I've tried everything for the OnSomeEvent parameter but none seem to work. Also not sure what ElementName should refer to.

My code:
[EventSubscriber(ObjectType::Table, 18,OnAfterInsertEvent,'',TRUE,TRUE)]
OR
[EventSubscriber(ObjectType::Table, 18,OnAfterInsertEvent(VAR Rec : Record Customer; RunTrigger : Boolean),'',TRUE,TRUE)]

The Target Page Job for the extension object is not found.

I am trying to extend table job using a tableextension.
I am getting attached error referring to "page job" not found etc.
though I guess it is because of the app.json file missing (Am I correct?), it should show error "table job" not found instead of "page job"
error
?

Run a Page (without MenuSuite)

I'm looking at the sample "TowersOfHanoi". In this case, it's a complete new app, with new objects. How do I run something like this while there is no MenuSuite available? Can I run an object (like the List) straight from VSCode? Or do I need to do some URL-magic in the web client for this?

Documentation trigger

Is documentation trigger of objects supported in Preview?
if yes, how should we add?
if no, is it in your roadmap to implement?

Code not fired in Sourcexp property of page field

#46

The field value is shown now in page but the code in sourexp is not fired.

field(Comments;ChechComments.CheckCommentsExist(Rec."No."))

I have added message statements in CheckCommentsExist function to test it and they are not fired.

Error while creating flowfield in table extension using Visual studio code

Hi all,
I have created a new tableextension object using Visual studio code which extends Item table.
I have created a field which is a flow field.
I have coded the following:
field(70000000;"Control Sample Qty";Decimal)
{
Editable=False;
FieldClass=FlowField;
DecimalPlaces=0:5;
CalcFormula=Sum(ControlStabilitySample."Sample Qty" WHERE ("Item No."=FIELD("No."),Status=FILTER(<>"QC Completed"),"Sample Type"=CONST("Control Sample"),"Loan License No."=FILTER(='')));
}
where, 'ControlStabilitySample' is a new table I have created in Visual studio code.
But the CalcFormula statement give me following error:
error AL0999: Internal error: 'Object reference not set to an instance of an object.', Stack trace=unknown

The statement which is creating error in CalcFormula is:
"Item No."=FIELD("No.").
Kindly suggest how to solve this.

Unable to run VSCode after F5

Hi, do not know if it is connected to AL or not, but on the VPC I have opened the PageExtensionMethod sample, pressed F5. The extension was correctly deployed. Than I closed the VSCode, and after I tried to run VSCode again I get this error and I cannot open the VSCode anymore:
[Window Title]
Error

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
Error: Cannot find module 'C:\Program Files (x86)\Microsoft VS Code\resources\app\out\main'
at Module._resolveFilename (module.js:455:15)
at Function.Module._resolveFilename (C:\Program Files (x86)\Microsoft VS Code\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:403:25)
at Object. (C:\Program Files (x86)\Microsoft VS Code\resources\electron.asar\browser\init.js:171:8)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)

[OK]

Again, I am not sure if it is connected to AL compiler or anything. What I remember is, that VSCode gives me error about "encoding" extensions which cannot be found or something like that before I closed the VSCode. I am filing this issue for you to see, if it will happen to someone else too...

If you want access to the machine, no problem. If not, I will discard it and create new one. Just tell me...

launch.json file

Is it mandatory to create launch.json file under vscode folder or can we create directly as other files? folder name also should be same vscode?
how does it know server details first time while creating launch.json file? what if we have multiple servicetiers?

DotNet Variables

Ist it possible yet to use DotNet Variables? And if yes how can i define them?

Greetings

Error while creating a decimal field in the January update

Hi,
I had created a decimal field previously in Visual studio code.
field(70000011;"Percentage";Decimal)
{
}
It worked properly previously. But now when I am creating a simple decimal field in the January update and installing the extension, my web client stops working due to the decimal field created and gives error that 'Server error has occured and the content cannot be displayed'.

image

error 2- while creating decimal field

Kindly give a solution to this.

VM Name

When creating the virtual machine I get an error because I already have another one with the name Server1.

Error after installing CU 2 NAV 2017

Hi all,
I installed the NAV 2017 CU 2 update on my VM which was created when Visual studio code preview was released. But I'm facing an issue with the web client. I cannot open any page on my web client since many errors appear. Also I am not able to publish my previous extension using visual studio code on this CU 2 update. It gives me following error:
'Could not publish the package to the server. See Visual Studio Code debug console for more details.'
Kindly let me know if any new VM has to be installed in order to use the NAV 2017 CU 2 update along with visual studio code.
Kindly give a solution to this. Thanks in advance.

RTC Crash

Created a field in "Jobs setup" and Job.
RTC crashing with below error in event viewer while selecting/entering values in Job Card. (working fine Job Setup page).
Is it related to VS code extension or something else?
NOTE: if I unistall extension then Job card is working fine. I cannot modify any standard field also in Job card when extension is installed.
crash event viewer.txt

Issue with Field named "Code"

Hi

I created a new simple table like this:

`
table 70001000 "Poison Class"
{
captionML = ENU='Poison Class';
DataPerCompany = true;

fields
{
    field(1;"Code";Code[10])
    {
        CaptionML=ENU='Code';
       // CaptionML=DES='Code';
    }
    field(2;Description;Text[50])
    {
        Captionml=ENU='Description';
       // Captionml=DES='Beschreibung';
    }
}
keys
{
    key(1;PrimaryKey;"Code")
    {
        Clustered=TRUE;
    }
    key(2;SecondaryKey;Description)
    {
        Clustered=False;
    }
}

}`

The I added a page

page 70001000 "Poison Classes" { PageType=List; SourceTable="Poison Class"; layout { area(content) { repeater(Steps) { field("Code";"Code"){} field(Description;Description){} } } } }

Sometimes VS don't know the field "Code". I tried it a couple of times. After I changed the name to "No" it worked. Then I rechanged it back to "Code". Very strange, now it works and I can't repro it in the same project. But when I create a new project and do the same steps I end in the same error.

ClientCrash

After deploying an extension, I experienced a repeated client crash. The extension added a field in item table and made that field visible on the item page.

crash

Debugging AL code using Visual Studio Code

Hi all,
Can someone please suggest how to debug AL code using visual studio code ?
The problem is I have put breakpoints in my code. When I press the debug button, it does not show any variable values or anything. It becomes equivalent to pressing F5. It does not debug actually.

Opinion on Syntax of a procedure

The current syntax for a simple function is this

local procedure TestMessage2();
begin
    message('Published event Event is working!')                
end;

Why is there a semicolon after the procedure. this feels really bad while coding.
also, I'd rather have no "begin" and "end". lots of statements work with { }. something like this is makes more sense to me:

local procedure TestMessage2()
{
    message('Published event Event is working!')                
}

... just my opinion

Native language support for azure functions

At EMEA Conference 2016 someone told us, that the usage of .net functions will be restricted in the new dev platform. As a compensation I would love to have native language support for azure functions.

New app(.json)

I notice you create a new guid for each app - the AppId .. makes sense ;-).

when creating a new app: do you manually have to create an app.json, or is there some kind of shortcut?
and if manual: how do you create a new guid from within vscode? Do you use the "guid" extension? or is there something in the al-extension that we can use for that?

No semicolons for method signatures

I find the semicolons at the end of the method signatures Terrible. Here is the example of OnRun (). Are the Really Necessary?

unbenannt

And I would prefer curly braces instead of BEGIN and END.

Caption ML Problem

Hi

I can't compile objects if I add more than one CaptionML

    field(1;"Code";Code[10])
    {
        CaptionML=ENU='Code';
        CaptionML=DES='Code';            
    }

Is the syntax wrong?

startupObjectId in the launch.json

I love the functionality, but .. it's just half cooked, I guess.

  1. would be nice to be able to work with names rather then the Id
  2. would be nice to not only have to work with pages, but start (any?) other object types as well

like:

have "StartupObject": Codeunit "MyNewMethodCodeunit"

with intellisense - if possible. :-)

Preserve data

When I press F5 after a previous build, I notice that I lost all data.

Do I have to foresee an upgrade-codeunit with the global functions as I had to in ExtensionsV1 as well?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.