I added 2 extra fields to the General Ledger Setup table and the page.
tableextension 2048890 tableextension2048890 extends "General Ledger Setup"
{
fields
{
field(50000;"Excise Decimal Places";Text[5])
{
CaptionML = ENU='Excise Decimal Places',
FRB='Nombre Décimales Accises',
NLB='Accijnsdecimalen';
Description = 'T6428';
InitValue = '2:2';
trigger OnValidate();
begin
CheckDecimalPlacesFormat("Excise Decimal Places");
end;
}
field(50001;"Excise Rounding Precision";Decimal)
{
CaptionML = ENU='Excise Rounding Precision',
FRB='Précision Arrondi Accises',
NLB='Accijnsafrondingsprecisie';
DecimalPlaces = 0:5;
Description = 'T6428';
InitValue = 0.0001;
trigger OnValidate();
begin
MESSAGE(gtxtc_RestartProgram);
end;
}
}
gtxtc_RestartProgram : TextConst ENU='You must close the program and start again in order to activate the unit-amount rounding feature.',FRB='Vous devez quitter le programme et redémarrer pour pouvoir activer la fonction d''arrondi montant unité.',NLB='U moet het programma afsluiten en opnieuw starten om de prijsafrondingsfunctie te activeren.';
}
pageextension 2049051 pageextension2049051 extends "General Ledger Setup"
{
layout
{
addafter(Application) //need new tab, not new group in tab
////addafter("Unrealized VAT") //= previous field
{
group(Product)
{
CaptionML = ENU='Product',
FRB='Product',
NLB='Product';
field("Excise Decimal Places";"Excise Decimal Places")
{
}
field("Excise Rounding Precision";"Excise Rounding Precision")
{
}
}
}
}
}
When I want to publish my extension, I get the following error:
[2018-01-04 10:46:37.72] Sending request to http://localhost:7049/Product/dev/apps
[2018-01-04 10:46:42.21] The request for path /Product/dev/apps failed with code InternalServerError. Reason: c:\ProgramData\Microsoft\Microsoft Dynamics NAV\110\Server\MicrosoftDynamicsNavServer$Product\source\PageExtension\PageExtension2049051.cs(103,13) : 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\110\Server\MicrosoftDynamicsNavServer$Product\source\PageExtension\PageExtension2049051.cs(103,197) : error CS1061: 'Microsoft.Dynamics.Nav.BusinessApplication.PageExtension2049051' does not contain a definition for 'GetDecimalString' and no extension method 'GetDecimalString' accepting a first argument of type 'Microsoft.Dynamics.Nav.BusinessApplication.PageExtension2049051' could be found (are you missing a using directive or an assembly reference?)
Wait, what?
Nowhere in the page nor table is 'Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.IEntityBase' used and GetDecimalString has no occurences when I search for that function/String.
(There are also other objects in the project, but they have no value for this problem.)
Specially:
When I remove the field "Excise Rounding Precision" from the page, the extension builds and publishes perfectly!
Using Microsoft_Application_11.0.19394.0.app & Microsoft_System_11.0.12925.0.app, no dependencies, Al Language 0.12.15355
pageextension 2049051 pageextension2049051 extends "General Ledger Setup" ?
Just a name the txt2AL created for me ...
Like I said, without the field "Excise Rounding Precision" on the page, the extension builds perfectly.
Looks related to #1212 . I will investigate both
Awesome! GL with it :)
Update:
Adding a function GetDecimalString with these parameters makes it compileable
procedure GetDecimalString(a : Record "Sales Header" ; b : Integer; c : Integer) : Text
var
begin
exit(format(a));
end;
Thank you for solving this issue. :)
But how can I get this fix?
On the NAV Development Preview – February Update site is written:
Please note, that the improvements announced in this blog post are not available in Dynamics NAV 2018 and the following cumulative updates of Dynamics NAV 2018.
Guess what I was using when reporting this issue? Dynamics NAV 2018!
You would need to file a support case for NAV 2018 and the fix will be backported to the next CU release.