NAV2018 : Token StartAttribute XML Error

While working with NAV2018 extension, I encountered this strange error when trying to build the package. The error message doesn’t explain much as well.

Processing of message 'al/createPackage' failed with error: 'Token StartAttribute in state Element Content would result in an invalid XML document.

It turned out the issue was on the compiler bug. One way to fix this issue was to update to newer version of AL Language. However, since I needed to develop for NAV2018, the latest AL Language that I could use was v0.13.472035. So what’s the workaround ?

Surprisingly enough, the error happens because the complier doesn’t like it when you put Allowed property after SourceTableView.

To fix it, you just need to put the SourceTableView after Allowed property, then the error magically disappears.

Or you can just run AZ AL Dev Tools to sort properties in the correct order.

Hope that helps you if you have the same issue with NAV2018.

thatnavguy

Experienced NZ-based NAV Developer and Consultant with 15+ years of experience leading multiple IT projects, performing business analyst, developing, implementing, and upgrading Dynamics NAV and Business Central. Passionate to deliver solution that focuses on user-friendly interface while keeping high standard of compliance with the needs.

You may also like...

2 Responses

  1. Kepha Murage says:

    Thanks a lot for this info.

    I am experiencing a similar issue but not exact one. I had several extensions which which have been working and I merged then into 1 extension, by just manually copy and pasting objects from other extensions to the core extension. And resolving errors.

    The merged app builds but fails to publish with the same error:
    [2024-11-12 10:17:04.74] The request for path /DynamicsNAV90-STAGE/dev/apps?SchemaUpdateMode=forcesync&DependencyPublishingOption=default failed with code UnprocessableEntity. Reason: Token StartAttribute in state Element Content would result in an invalid XML document.

    I tried your solution and a couple of others like trying to regenerate manifest file, permission set file, etc and it still fails to publish.

    What could be the issue?

    • thatnavguy says:

      Hi Kepha,

      It’s hard to know the issue. I found a way to fix mine just because I usually sort the properties of the objects.
      You can try running the AZ AL Dev Tools Code CleanUp (such as Properties, Identifier, etc.) and see if it works.

Leave a Reply

Your email address will not be published. Required fields are marked *