hougaard / Simple-Object-Designer

Issue tracking for the Simple Object Designer for Business Central
7 stars 0 forks source link

Deployment failed: missing tables #324

Closed otherjoel closed 7 months ago

otherjoel commented 7 months ago

Today after updating to SOD 10.0.0.378, I added a field to one of my features. When I deployed the app to the same environment (a sandbox) I received this error:

Deployment failed. Errors: App ID : ab8e6875-5d1e-42cb-b326-da92f749c926 Message : { Extension compilation failed
Management/FieldManagement.al(713,19): error AL0185: Table 'ANITA_InvoiceWin' is missing
Management/FieldManagement.al(714,17): error AL0185: Table 'CxpRegisterWin' is missing }

The lines in question are lines 4 and 5 below in the app's Management/FieldManagement.al:

[EventSubscriber(ObjectType::Page, Page::"Document Attachment Factbox", 'OnBeforeDrillDown', '', false, false)]
local procedure OnBeforeDrillDown(DocumentAttachment: Record "Document Attachment"; var RecRef: RecordRef);
var
ANITA_InvoiceWin: Record ANITA_InvoiceWin;
CxpRegisterWin: Record CxpRegisterWin;
begin
    case DocumentAttachment."Table ID" of
DATABASE::ANITA_InvoiceWin:
    begin
        RecRef.Open(DATABASE::ANITA_InvoiceWin);
        if ANITA_InvoiceWin.Get(DocumentAttachment."No.") then
            RecRef.GetTable(ANITA_InvoiceWin);
    end;
DATABASE::CxpRegisterWin:
    begin
        RecRef.Open(DATABASE::CxpRegisterWin);
        if CxpRegisterWin.Get(DocumentAttachment."No.") then
            RecRef.GetTable(CxpRegisterWin);
    end;
    end;
end;

I'm no AL expert, but I think the actual table names generated for these tables by SOD are different. For example, one of the referenced tables appears to be defined in the app's Features\ANITA_Invoice\ANITA_Invoice.Header.Table.al:

table 53050 "ANITA_Invoice HeaderWin"
{
    TableType = Normal;
    Caption = 'ANITA Invoices Header';
    […]

Sp it looks to me like maybe SOD is not using the correct names for these tables in FieldManagement.al.

Both of these features are “Document” type features that have both "Add standard FactBoxes" options enabled. These factboxes were already enabled in the past for one of these features that was deployed to our prod environment. But from the git repo for my app I can tell that these lines in FieldManagement.al were not being generated until recently.

This is on BC 22.5.59966.60134.

otherjoel commented 7 months ago

If I disable the "Add standard FactBoxes" options for both features, the deployment completes successfully.

hougaard commented 7 months ago

Fix is on its way to appsource later today...

hougaard commented 7 months ago

Try it now...

hougaard commented 7 months ago

(update first)

otherjoel commented 7 months ago

Deployment successful! Thank you :) there's one other issue, but I opened a separate one for that,.