AL icon indicating copy to clipboard operation
AL copied to clipboard

Unable to publish page-extension with group control anchors since BC14 (The metadata object <ControlXXX> was not found / The operation X is not valid for the given anchor control : <ControlXXX>)

Open rvanbekkum opened this issue 7 years ago • 6 comments

Describe the bug With the update to BC140 (BC April '19 Release) we get the following error trying to publish our page-extensions:

The request for path /BC140/dev/apps?SchemaUpdateMode=synchronize failed with code 422. Reason: An error occurred while applying changes from the object of type 'PageExtension' with ID '{OurPageExtensionID}' in the '{OurAppName}' app to the application object of type 'Page' with the ID '30' The error was: InvalidOperationException - Metadata delta application failed due to the following error(s): The metadata object Control1907509201 was not found.

This worked fine, in BC130 (BC Fall '18 Release), but then we needed to refer to the ENU caption (for the example below that would be "Warehouse)").

The app does compile ("AL: Package"), but we are unable to publish it. Only when trying to publish we get the error message. As you can understand, this is quite an issue!

To Reproduce Create a new AL project, download the symbols ("AL: Download Symbols"), and add an AL file with the following contents:

pageextension 50110 wItemCard extends "Item Card"
{
    layout
    {
        addlast(Control1907509201)
        {
            field(MyField; 42) { }
        }
    }
}

(i.e., this would add a field add the end of the "Warehouse" group)

Try to publish the app (with "AL: Publish"). Then you will get the error message in the debug console and publishing fails.

I have tried this on multiple databases, including a clean W1 and clean NL database (version: 14.0.29537/29530).

Expected behavior No error message on this as the group control does exist, so publishing the app should be successful.

Screenshots image

Versions:

  • AL Language: 3.0.115791
  • Business Central: 14.0.29537/29530

rvanbekkum avatar Apr 12 '19 15:04 rvanbekkum

Another example:

pageextension 50110 wItemCard extends "Item Card"
{
    layout
    {
        addlast(Control230)
        {
            field(MyField; 42) { }
        }
    }
}

will compile, but once you try to publish you will get the following error message in the Debug Console reported from the server:

The request for path /BC140/dev/apps?SchemaUpdateMode=synchronize failed with code 422.
Reason: An error occurred while applying changes from the object of type 'PageExtension' with ID '50110' in the '<MyAppNameAndPublisher>' app to the application object of type 'Page' with the ID '30'
The error was: InvalidOperationException - Metadata delta application failed due to the following error(s): 
The operation ContentFirst is not valid for the given anchor control : Control230

This did work fine in BC13, doing an addfirst(Production) { ... }, but now we are unable to use the control as an anchor (again, it does compile, but the server won't accept the extension when trying to publish).

rvanbekkum avatar Apr 15 '19 11:04 rvanbekkum

I ran across this too. What happened for example is that some things are renamed from BC13 to BC14

For example anchor point "Inventory" on Item List got renamed to "Control113" and our app didn't compile. In docker image of BC 14.0 it's still "Inventory" on our sandbox on SaaS it's named "Control113" See: https://imgur.com/uxzZYy2

Mr-Pingu avatar Apr 19 '19 07:04 Mr-Pingu

Any update on this issue? Example is referencing "Production" anchor on Item List, which now must be referenced as Control230 in VS Code to compile, but when publishing in BC365 on-prem, get the following:

image

MarceeMarc avatar May 22 '19 14:05 MarceeMarc

Any updates on this one? Seems to be a disconnect between compiler and installer! Unable to publish some extensions.

MarceeMarc avatar May 24 '19 14:05 MarceeMarc

We had to change the naming algorithm for controls and action without names in preparation for the switch from C/AL to AL. This meant that controls that had a name before Spring, might have received another name after Spring. Please try it out on the latest CU and let us know if you still encounter issues. Please remember to regenerate symbols using C/SIDE.

atoader avatar Aug 09 '19 11:08 atoader

The original issue (i.e., due to mismatches being unable to use some controls as anchors) seems to be resolved with the latest CUs. I think you can close this issue.

rvanbekkum avatar Aug 09 '19 13:08 rvanbekkum