AL icon indicating copy to clipboard operation
AL copied to clipboard

Can't upload/deploy extension with PageType = API

Open thomasbarbut opened this issue 8 years ago • 8 comments

Hello everyone,

I'm trying to deploy/upload an .app package where PageType=API and I get this error: Unexpected error. There was an unknown error when attempting to deploy the extension. Try to deploy again.

Strange thing is that it work when using PUBLISH command in the sandbox.

  • AL Extension Version: 0.16.19969
  • Server Version: US Dynamics NAV 12.3 (23918)

I will be publishing a another table and page. This is just an example. `page 50113 WLTCustomerAPI3 { PageType = API; SourceTable = Customer; EntityName = 'WLTCustomer'; EntitySetName = 'WLTCustomers'; APIPublisher = 'UGP'; APIGroup = 'WLT'; ODataKeyFields = "No."; APIVersion = 'beta'; DelayedInsert = true;

layout
{
    area(content)
    {
        repeater(Group)
        {
          field("No."; "No.")
          {
              ApplicationArea = All;
          }
        }
    }
}

}`

thomasbarbut avatar Sep 08 '18 14:09 thomasbarbut

Anything in the server's eventviewer? On the other hand I could deploy this on the latest docker image Al extension/server version with some modifications enforced by compiler errors. Which you did not probably get because you run on an older version. Try with field(No; "No.") and adding also a Caption on the page and the field

kalberes avatar Sep 09 '18 14:09 kalberes

Hello, it is Business Central. It's on the cloud. No event viewer.

I'll try what you suggested and get back to you. Thanks

thomasbarbut avatar Sep 09 '18 15:09 thomasbarbut

Hello,

unfortunately I have the same error: Unexpected error. There was an unknown error when attempting to deploy the extension. Try to deploy again. - Job Id : 0c888067-d120-4ca0-b4ff-c393b767a3a2

Here is the code I've tried according to your suggestion.

page 50113 WLTCustomerAPI3 { PageType = API; SourceTable = Customer; EntityName = 'wltcustomer'; EntitySetName = 'wltcustomers'; APIPublisher = 'UGP'; APIGroup = 'WLT'; //ODataKeyFields = id; APIVersion = 'beta'; DelayedInsert = true; Caption = 'testAPI';

layout
{
    area(content)
    {
        repeater(Group)
        {
          field(No; "No.")
          {
              Caption = 'No';
              ApplicationArea = All;
          }
        }
    }
}

}

thomasbarbut avatar Sep 09 '18 17:09 thomasbarbut

This exact code works for me on the latest docker image. Can you deploy other type of pages?

kalberes avatar Sep 10 '18 07:09 kalberes

It's not working with Live/Production of Business Central(dynamics.com). Try it there. Stop trying to reproduce it with the docker image and/or sandbox and you will experience the same error.

Other pages work just fine.

thomasbarbut avatar Sep 10 '18 07:09 thomasbarbut

Hi Thomas. I'm also having difficulty experiencing the error. We do get an error log for the Job ID that you posted that indicates that the error is happening during validation. Using the API page code that you posted I've created an extension and have tried enabling the PerTenantExtensionCop analyzer in VSCode to validate it and have also tried uploading that extension to Business Central. Neither of those show any errors for me.

Is there anything else that your .app file contains besides the API page? (permission sets, other objects, etc..) Does your .app file contain any protected IP? If not, would you be willing to post the .app file that you were trying to upload?

RobAnderson42 avatar Sep 13 '18 18:09 RobAnderson42

Hello Rob,

first of all I'd like to thank you for your feedback. Below image and zip for the entire project. entire project

Here is the entire project folder. It contains source files and .app file. ALProject15try2.zip

Hopefully you can figure it out.

best regards, Thomas Barbut.

thomasbarbut avatar Sep 13 '18 22:09 thomasbarbut

Hi Thomas. The issue that caused this error has been fixed and we are in the process of rolling out updates to the backend components in all regions. This should be completed by early next week and you should then no longer see the error when uploading that extension.

Thank you for reporting the issue and for your patience while we work to get this resolved.

RobAnderson42 avatar Sep 19 '18 16:09 RobAnderson42