AL icon indicating copy to clipboard operation
AL copied to clipboard

Publish operation failed with code PackageDeployFailed.

Open Twija opened this issue 8 years ago • 1 comments

i found the same issues #2064,but i couldnt solve issue with that answer.

in my case, i use a sandbox ver. GB Dynamics NAV 12.0 (21229) and set the enableCodeAnalysis also. and i created an extention with tables, pages, codeunit and report.

when i published through the VS code, it works perfectly. but when i uploaded it in the extension management page, it failed with below message. "Publish operation failed with code PackageDeployFailed. Details: The extension failed to be deployed successfully. View the error details for more information and then deploy again. "

BTW, where can i find and see the details??

so i tried to upload one by one increasing revision #. case1 - one table extension and one page extension => uploaded. case2 - case1 + one table extension and two page extensions => uploaded. case3 - case2 + one report => uploaded. case4 - case3 + one codeunit = > failed.

content of the codeunit is here

codeunit 50100 DXKSalesHeaderEvent
{
    [EventSubscriber(ObjectType::Table, database::"Sales Header", 'OnAfterInitRecord', '', false, false)]
    local procedure OnAfterInitRecord(var SalesHeader: Record "Sales Header")
    var
        customer: Record Customer;
    begin
        if not customer.get(SalesHeader."Sell-to Customer No.") then exit;

        SalesHeader."DXK Bank Account" := customer."DXK Bank Account";
    end;
}

i think it is nothing special. give me any advices

thank you.

Twija avatar May 25 '18 02:05 Twija

The PackageValidationError is because of a known issue in the processing of the validation rules in the Extension Management Regional Service. The issue has been resolved and is currently schedule to be deployed to prod tenatnthis week. The issue occurs when the subscription attribute contains the object name. You can move past this PackageValidationError by making a small code change to use the object id.
For example: [EventSubscriber(ObjectType::Codeunit, Codeunit::MyEventCodeunit, 'OnMyEvent', '', true, true)]

If they change the attribute to use the object ID, then it’ll avoid the null reference exception. [EventSubscriber(ObjectType::Codeunit, 50100, 'OnMyEvent', '', true, true)]

This happens in production tenant deployment because the validation rules are running when the extension is uploaded through the Extension Management page. For sandbox deployments where the Partners tipically deploy directly from VSCode, the validation rules are not run on deployment.

dtacconi avatar May 29 '18 15:05 dtacconi