Error (property order issue in Nav 2018)
Microsoft (R) AL Compiler version 0.12.17720 Copyright (C) Microsoft Corporation. All rights reserved
[Error - 01:30:55] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'al/createPackage' failed with error: 'Token StartAttribute in state Element Content would result in an invalid XML document.'
StackTrace:
at System.Xml.XmlWellFormedWriter.ThrowInvalidStateTransition(Token token, State currentState)
at System.Xml.XmlWellFormedWriter.AdvanceState(Token token)
at System.Xml.XmlWellFormedWriter.WriteStartAttribute(String prefix, String localName, String namespaceName)
at System.Xml.XmlWriter.WriteAttributeString(String localName, String value)
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.ObjectMetadataEmitHelper.WritePropertyValueMetadata(XmlWriter xmlWriter, PropertySymbol property) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\ObjectMetadataEmitHelper.cs:line 101
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.ObjectMetadataEmitter.WritePropertyValueMetadata(XmlWriter xmlWriter, PropertySymbol property) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\ObjectMetadataEmitter.cs:line 54
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.ObjectMetadataEmitHelper.WriteAttributeProperties(XmlWriter xmlWriter, IEnumerable1 properties, Action2 writePropertyMetadata) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\ObjectMetadataEmitHelper.cs:line 69
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.ObjectMetadataEmitHelper.WriteProperties(XmlWriter xmlWriter, Symbol declaringSymbol, IEnumerable1 properties, Action2 writePropertyMetadata, Boolean shouldOutputDefaultProperties) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\ObjectMetadataEmitHelper.cs:line 38
at Microsoft.Dynamics.Nav.CodeAnalysis.Emit.PageMetadataEmitter.<>c__DisplayClass3_0.1.EmitMetadata(Action1 content) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Emitter\GenericObjectMetadataEmitter.cs:line 37
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileObject(ObjectTypeSymbol containingType) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 248
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.<>c__DisplayClass17_0.1 filterOpt, CancellationToken cancellationToken) in C:\Agent\_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 145
at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.CompileImpl(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 810
at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.Compile(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate`1 filterOpt, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 787
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.PackageTheModule(Compilation compilation, CompilerTextWriter consoleOutput, CancellationToken cancellationToken, ErrorLogger errorLogger, AnalyzerDriver analyzerDriver) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 531
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 413
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.Run(CompilerTextWriter consoleOutput, CancellationToken cancellationToken) in C:\Agent_work\41\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 312
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.CreatePackageRequestHandler.
Would it been possible to narrow down your code to a simple repro. Looks like emitting metadata for one of the page properties' fails.
Hi all,
I have this error, or very similar. This can be reproduced with this kind of page
page 54000 "Test" { PageType = List; SourceTable = "Sales Line"; SourceTableView = where (Type = const (Item)); DelayedInsert = true; AutoSplitKey = true; layout { area(content) { group(GroupName) { field("No."; "No.") { ApplicationArea = All; } } } } }
As far as I know, if I put DelayedInsert and Autosplitkey properties just after the PageType, the problem disappears.
I've seen this kind of error with other properties (I don't remember which ones), where the order of the properties can solve or make problems when compiling.
Regards!
I have no repro for this the latest version. But this looks like a Nav 2018 related issue. We have had bugs related to property dependencies, but I am not sure they were back-ported to Nav 2018. Please raise a ticket with CSS to get this issue back-ported.
Hi @All I have installed CU6 for 2018 and still facing the same issue that @jprada842 is facing. I have added a new Customize page of Type ListPart and made property of DelayedInsert as TRUE, code get compiled but the moment I do F5 to publish it throws an error :
"The request for path /dynamicsnav110cu6/dev/apps?SchemaUpdateMode=recreate failed with code 422. Reason: Token StartAttribute in state Element Content would result in an invalid XML document."
Hi @thpeder / @jprada842 / @kalberes / @salmosa1 I think i somehow found a reason for this (still I will say it as a Bug):
when you mention DelayedInsert property after SourceTableView then you will get this message.

The moment you mention this property before Sourcetableview is works :)

I have had this problem with the order of the properties on pages many times (don't know if other objects also have a specific order for properties). It would be very helpful to have a list of the property order, that the compiler expects. Then we would not have to use a lot of time to try different orders or to search for a solution to the strange error.
Could someone provide a list of the expected order of properties?
Hi @jprada842, @rishiaurrishabh, @MiePlougstrup, Apologies for a late reply.
There is no required order of properties for the compiler, therefore we can't really share anything like that. When you encounter such an issue, this is a bug and it must get fixed.
In the latest codebase, all known issues like this are already fixed, however it is possible that not all fixes have been backported to Nav 2018. Therefore, if you could open a support case for Nav 2018, the team responsible for that will take care of this request.