D365BC API Query Exceptions with Extended Fields

Hello,

To prevent customer table locks from recurring each time an integration reads OData from Business Central, I created an API Query Extension in AL.

Everything resolves in VSCode without a problem; however, I get the following exception when I attempt to upload my extension to the sandbox:

The supplied field number "55217" cannot be found in the Customer Table.

I opened a customer record and verified that field 55217 exists within the table and page extension:

Field 55217 on the Customer Table is a Text[50] flow field that correlates to a Text[50] field on the Salespeople/Purchasers extended table/page.

I attempted to enlist the aid of Microsoft Support to identify why, despite resolving without a problem in VSCode, the Extension installation keeps failing. The moment they saw that this related to an extension, I was told they would not render support and to post this on the support (Case 119103124004346).

Any assistance would be greatly appreciated. In addition to understanding why this query fails to recognize field 55217, I am also curious about why API Queries are used over Normal Queries for the sake of integrations.


Customer Table Extension:

tableextension 55200 "SWC-SV00 Customer" extends Customer
{ // These are fields added to support the sync from BC to Shopify, Salesforce, and Zendesk
    fields
    {
        field(55200; "SWC-SV Shopify ID"; Code[20])
        {
            Caption = 'Shopify ID';
            DataClassification = CustomerContent;
        }
        field(55201; "SWC-SV SalesForce ID"; Text[50])
        {
            Caption = 'SalesForce ID';
            DataClassification = CustomerContent;
        }
        field(55202; "SWC-SV Zendesk ID"; Code[50])
        {
            Caption = 'Zendesk ID';
            DataClassification = CustomerContent;
        }
        field(55203; "SWC-SV Shopify User Email"; Text[150])
        {
            Caption = 'Shopify User Email';
            DataClassification = CustomerContent;
        }
        field(55204; "SWC-SV Created By"; Code[50])
        {
            Caption = 'Created By';
            DataClassification = CustomerContent;
            TableRelation = "User Setup";
        }
        field(55205; "SWC-SV Modified By"; Code[50])
        {
            Caption = 'Modified By';
            DataClassification = CustomerContent;
            TableRelation = "User Setup";
        }
        field(55206; "SWC-SV Created Date"; Date)
        {
            Caption = 'Created Date';
            DataClassification = CustomerContent;
        }
        field(55207; "SWC-SV Created DateTime"; DateTime)
        {
            Caption = 'Created Date-Time';
            DataClassification = CustomerContent;
        }
        field(55208; "SWC-SV Modified Date"; Date)
        {
            Caption = 'Modified Date';
            DataClassification = CustomerContent;
        }
        field(55209; "SWC-SV Modified DateTime"; DateTime)
        {
            Caption = 'Modified Date-Time';
            DataClassification = CustomerContent;
        }
        field(55210; "SWC-SV Modified on Behalf"; text[50])
        {
            //This is the modifying user in the other system pushed in by Sync.
            Caption = 'Modified on Behalf';
            DataClassification = CustomerContent;
        }
        field(55211; "SWC-SV Apply Template"; Code[10])
        {
            //on validate to trigger the apply template process for that template.
            Caption = 'Template to Apply';
            DataClassification = CustomerContent;
            TableRelation = "Config. Template Header".Code where("Table ID" = const(18));

            trigger OnValidate();
            var
                ConfigTemplateHeader: record "Config. Template Header";
                DimensionsTemplate: Record "Dimensions Template";
                ConfigTemplateManagement: Codeunit "Config. Template Management";
                RecRef: RecordRef;
            begin
                if ("SWC-SV Apply Template" <> '') AND (xRec."SWC-SV Apply Template" <> "SWC-SV Apply Template") then begin
                    ConfigTemplateHeader.Get("SWC-SV Apply Template");
                    RecRef.GetTable(Rec);
                    ConfigTemplateManagement.UpdateRecord(ConfigTemplateHeader, RecRef);
                    DimensionsTemplate.InsertDimensionsFromTemplates(ConfigTemplateHeader, "No.", database::Customer);
                    recref.SetTable(Rec);
                end;
            end;
        }
        field(55212; "SWC-SV Shopify Activ URL"; Boolean)
        {
            //This is ment to trigger a post script to shopify to send the customer an activation url. 
            //POST /admin/api/2019-04/customers/#{customer_id}/account_activation_url.json
            Caption = 'Send Shopify Activation URL';
            DataClassification = CustomerContent;
        }
        field(55213; "SWC-SV Shopify Invite"; Boolean)
        {
            //This is ment to trigger a post script to shopify to send the customer a welcome email. 
            //POST /admin/api/2019-04/customers/#{customer_id}/send_invite.json
            Caption = 'Send Shopify Invite Email';
            DataClassification = CustomerContent;
        }
        field(55214; "SWC-SV Shopify Activ URL Date"; DateTime)
        {
            //This is ment to be backfilled by eOne after succesful change
            Caption = 'Shopify Activation URL Sent on';
            DataClassification = CustomerContent;
        }
        field(55215; "SWC-SV Shopify Invite Date"; DateTime)
        {
            //This is ment to be backfilled by eOne after succesful change
            Caption = 'Shopify Invite Email Sent on';
            DataClassification = CustomerContent;
        }
        field(55216; "SWC-SV Set Territory Dim."; Boolean)
        {
            //This is ment to be triggered when a new customer is created.
            Caption = 'Set Territory Dim. Code';
            DataClassification = CustomerContent;

            trigger OnValidate();
            begin
                IF "SWC-SV Set Territory Dim." THEN BEGIN
                    UpdateTeritoryDimension();
                END;
            END;
        }
        field(55217; "SWC-SV SP SF Owner ID"; Text[50])
        {
            Caption = 'Sales Person Owner ID';
            FieldClass = FlowField;
            CalcFormula = LOOKUP ("Salesperson/Purchaser"."SWC-SV SalesForce Owner ID" WHERE("Code" = FIELD("Salesperson Code")));
        }
        field(55218; "SWC-SV Shopify Prevent Sync"; Boolean)
        {
            Caption = 'Shopify Prevent Sync';
        }
        field(55219; "SWC-SV Shopify Address ID"; Code[20])
        {
            Caption = 'Shopify Default Address ID';
        }
        field(55220; "SWC-SV Customer Class"; Text[50])
        {
            //on validate to trigger the apply template process for that template.
            Caption = 'Customer Classification';
            DataClassification = CustomerContent;
            TableRelation = "SWC-SV00 Customer Class".Classifcation;
        }
        field(55221; "SWC-SV SalesForce Prevent Sync"; Boolean)
        {
            Caption = 'SalesForce Prevent Sync';
        }
    }
    //Added Sync key to aid in odata lookup of record for insert/update   
    keys
    {
        key(Sync; "SWC-SV Shopify ID", "SWC-SV SalesForce ID", "SWC-SV Zendesk ID", "SWC-SV Shopify User Email")
        {
            //Unique = true;  //Cannot do in table extension
        }
    }
    fieldgroups
    {
        addlast(DropDown;
        "E-Mail")
        {
        }
    }
    //Event Triggers
    trigger OnBeforeInsert()
    var
        customer: record Customer;
    begin
        //Since Key Unique is not available for table extension
        if "SWC-SV Shopify ID" <> '' then begin
            customer.reset();
            customer.SetFilter("SWC-SV Shopify ID", rec."SWC-SV Shopify ID");
            if not customer.IsEmpty() then Error('Shopify ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Shopify ID");
        END;
        if "SWC-SV SalesForce ID" <> '' then begin
            customer.reset();
            customer.SetFilter("SWC-SV SalesForce ID", rec."SWC-SV SalesForce ID");
            if not customer.IsEmpty() then Error('SalesForce ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV SalesForce ID");
        END;
        if "SWC-SV Zendesk ID" <> '' then begin
            customer.reset();
            customer.SetFilter("SWC-SV Zendesk ID", rec."SWC-SV Zendesk ID");
            if not customer.IsEmpty() then Error('Zendesk ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Zendesk ID");
        END;
    end;

    trigger OnInsert();
    var
        customer: record Customer;
    begin
        //Since Key Unique is not available for table extension
        if "SWC-SV Shopify ID" <> '' then begin
            customer.reset();
            customer.SetFilter("SWC-SV Shopify ID", rec."SWC-SV Shopify ID");
            if not customer.IsEmpty() then Error('Shopify ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Shopify ID");
        END;
        if "SWC-SV SalesForce ID" <> '' then begin
            customer.reset();
            customer.SetFilter("SWC-SV SalesForce ID", rec."SWC-SV SalesForce ID");
            if not customer.IsEmpty() then Error('SalesForce ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV SalesForce ID");
        END;
        if "SWC-SV Zendesk ID" <> '' then begin
            customer.reset();
            customer.SetFilter("SWC-SV Zendesk ID", rec."SWC-SV Zendesk ID");
            if not customer.IsEmpty() then Error('Zendesk ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Zendesk ID");
        END;
        "SWC-SV Created By" := UserId();
        "SWC-SV Created Date" := Today();
        "SWC-SV Created DateTime" := CurrentDateTime();
    end;

    trigger OnModify();
    var
        SmokingVaporSetup: Record "SWC-SV00 Smoking Vapor Setup";

    begin
        "SWC-SV Modified By" := UserId();
        "SWC-SV Modified Date" := Today();
        "SWC-SV Modified DateTime" := CurrentDateTime();

        //for the shopify sync to prevent rubberbanding.   Salesforce syncs directly set this to false.
        SmokingVaporSetup.Get();
        If UserId() <> SmokingVaporSetup."Integration User ID" then begin
            "SWC-SV Shopify Prevent Sync" := False;
            "SWC-SV SalesForce Prevent Sync" := False;
        end;

    end;

    procedure UpdateTeritoryDimension()
    var
        SalesSetup: Record "Sales & Receivables Setup";
        GeneralLedgerSetup: Record "General Ledger Setup";
        DefaultDimension: Record "Default Dimension";
        PostCode: Record "Post Code";
        PoastalCodeCounties: Record "SWC-SV00 Postal Code Counties";
    begin
        SalesSetup.GET();
        SalesSetup.TESTFIELD("SWC-SV Territory Dim. Code");
        GeneralLedgerSetup.GET();
        IF SalesSetup."SWC-SV Territory Dim. Code" IN [GeneralLedgerSetup."Global Dimension 1 Code", GeneralLedgerSetup."Global Dimension 2 Code"] THEN BEGIN
            IF (PostCode.GET("Post Code", City)) AND (PoastalCodeCounties.GET(PostCode.County, PostCode."SWC-SV County Name")) AND (PoastalCodeCounties."Territory Dimension Code" <> '') THEN BEGIN
                IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 1 Code" THEN BEGIN
                    VALIDATE("Global Dimension 1 Code", PoastalCodeCounties."Territory Dimension Code");
                END;
                IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 2 Code" THEN BEGIN
                    VALIDATE("Global Dimension 2 Code", PoastalCodeCounties."Territory Dimension Code");
                END;
            END
            ELSE BEGIN
                IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 1 Code" THEN BEGIN
                    VALIDATE("Global Dimension 1 Code", '');
                END;
                IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 2 Code" THEN BEGIN
                    VALIDATE("Global Dimension 2 Code", '');
                END;
            END;
        END
        ELSE BEGIN
            IF (PostCode.GET("Post Code", City)) AND (PoastalCodeCounties.GET(PostCode.County, PostCode."SWC-SV County Name")) AND (PoastalCodeCounties."Territory Dimension Code" <> '') THEN BEGIN
                DefaultDimension.RESET();
                DefaultDimension.SETRANGE("Table ID", DATABASE::Customer);
                DefaultDimension.SETRANGE("No.", "No.");
                DefaultDimension.SETRANGE("Dimension Code", SalesSetup."SWC-SV Territory Dim. Code");
                IF DefaultDimension.FIND('-') THEN BEGIN
                    DefaultDimension.VALIDATE("Dimension Value Code", PoastalCodeCounties."Territory Dimension Code");
                    DefaultDimension.MODIFY(TRUE);
                END
                ELSE BEGIN
                    DefaultDimension.INIT();
                    DefaultDimension.VALIDATE("Table ID", DATABASE::Customer);
                    DefaultDimension.VALIDATE("No.", "No.");
                    DefaultDimension.VALIDATE("Dimension Code", SalesSetup."SWC-SV Territory Dim. Code");
                    DefaultDimension.VALIDATE("Dimension Value Code", PoastalCodeCounties."Territory Dimension Code");
                    DefaultDimension.INSERT(TRUE);
                END;
            END
            ELSE BEGIN
                DefaultDimension.RESET();
                DefaultDimension.SETRANGE("Table ID", DATABASE::Customer);
                DefaultDimension.SETRANGE("No.", "No.");
                DefaultDimension.SETRANGE("Dimension Code", SalesSetup."SWC-SV Territory Dim. Code");
                IF DefaultDimension.FIND('-') THEN BEGIN
                    DefaultDimension.DELETE(TRUE);
                END;
            END;
        END;
    end;
}

Salesperson/Purchaser Table Extension:

tableextension 55207 "SWC-SV00 Salesperson/Purchaser" extends "Salesperson/Purchaser" //MyTargetTableId
{
    fields
    {
        field(55200; "SWC-SV SalesForce Owner ID"; Text[50])
        {
            Caption = 'SalesForce Owner ID';
            DataClassification = CustomerContent;
        }
        field(55201; "SWC-SV Zendesk ID"; Code[50])
        {
            Caption = 'Zendesk ID';
            DataClassification = CustomerContent;
        }
        field(55204; "SWC-SV Created By"; Code[50])
        {
            Caption = 'Created By';
            DataClassification = CustomerContent;
            TableRelation = "User Setup";
        }
        field(55205; "SWC-SV Modified By"; Code[50])
        {
            Caption = 'Modified By';
            DataClassification = CustomerContent;
            TableRelation = "User Setup";
        }
        field(55206; "SWC-SV Created Date"; Date)
        {
            Caption = 'Created Date';
            DataClassification = CustomerContent;
        }
        field(55207; "SWC-SV Created DateTime"; DateTime)
        {
            Caption = 'Created Date-Time';
            DataClassification = CustomerContent;
        }
        field(55208; "SWC-SV Modified Date"; Date)
        {
            Caption = 'Modified Date';
            DataClassification = CustomerContent;
        }
        field(55209; "SWC-SV Modified DateTime"; DateTime)
        {
            Caption = 'Modified Date-Time';
            DataClassification = CustomerContent;
        }
        field(55210; "SWC-SV Modified on Behalf"; text[50])
        {
            //This is the modifying user in the other system pushed in by Sync.
            Caption = 'Modified on Behalf';
            DataClassification = CustomerContent;
        }
    }
    //Added Sync key to aid in odata lookup of record for insert/update   
    keys
    {
        key(Sync; "SWC-SV SalesForce Owner ID")
        {
            //Unique = true;  //Cannot do in table extension
        }
    }
    //Event Triggers
    trigger OnInsert();
    begin
        "SWC-SV Created By" := UserId();
        "SWC-SV Created Date" := Today();
        "SWC-SV Created DateTime" := CurrentDateTime();
    end;

    trigger OnAfterInsert();
    begin
        UpdateDimensionValue_gFnc(0);
    end;

    trigger OnModify();
    begin
        "SWC-SV Modified By" := UserId();
        "SWC-SV Modified Date" := Today();
        "SWC-SV Modified DateTime" := CurrentDateTime();
        UpdateDimensionValue_gFnc(1);
    end;

    trigger OnBeforeDelete();
    begin
        UpdateDimensionValue_gFnc(2);
    end;

    trigger OnAfterRename();
    begin
        UpdateDimensionValue_gFnc(3);
    end;

    procedure UpdateDimensionValue_gFnc(KeyChange_pOpt: Option Insert,Modify,Delete,Rename)
    var
        DimensionValue_lRec: Record "Dimension Value";
        DefaultDimension_lRec: Record "Default Dimension";
        SalesSetup_lRec: Record "Sales & Receivables Setup";
        GeneralLedgerSetup_lRec: Record "General Ledger Setup";
    begin
        SalesSetup_lRec.Get();
        SalesSetup_lRec.TESTFIELD("Salesperson Dimension Code");
        case KeyChange_pOpt of
            KeyChange_pOpt::Insert:
                begin
                    if not DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", Code) then begin
                        DimensionValue_lRec.Init();
                        DimensionValue_lRec.VALIDATE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code");
                        DimensionValue_lRec.VALIDATE(Code, Code);
                        DimensionValue_lRec.INSERT(true);
                    end
                    else begin
                        DimensionValue_lRec.VALIDATE(Blocked, false);
                        DimensionValue_lRec.MODIFY(true);
                    end;
                end;
            KeyChange_pOpt::Modify:
                begin
                    if xRec.Name <> Name then begin
                        DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", Code);
                        DimensionValue_lRec.VALIDATE(Name, name);
                        DimensionValue_lRec.MODIFY(true);
                    end;
                end;
            KeyChange_pOpt::Delete:
                begin
                    DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", Code);
                    if DimensionValue_lRec.CheckIfDimValueUsed() then begin
                        DimensionValue_lRec.VALIDATE(Blocked, true);
                        DimensionValue_lRec.Modify(true);
                    end
                    else begin
                        DimensionValue_lRec.DELETE(true);
                    end;
                end;
            KeyChange_pOpt::Rename:
                begin
                    DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", xRec.Code);
                    DimensionValue_lRec.RENAME(SalesSetup_lRec."Salesperson Dimension Code", Code);
                end;
        end;
        IF NOT (KeyChange_pOpt IN [KeyChange_pOpt::Modify, KeyChange_pOpt::Delete]) then begin
            GeneralLedgerSetup_lRec.GET();
            IF SalesSetup_lRec."Salesperson Dimension Code" IN [GeneralLedgerSetup_lRec."Global Dimension 1 Code", GeneralLedgerSetup_lRec."Global Dimension 2 Code"] THEN BEGIN
                IF (Code <> '') THEN BEGIN
                    IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 1 Code" THEN BEGIN
                        VALIDATE("Global Dimension 1 Code", Code);
                    END;
                    IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 2 Code" THEN BEGIN
                        VALIDATE("Global Dimension 2 Code", Code);
                    END;
                END
                ELSE BEGIN
                    IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 1 Code" THEN BEGIN
                        VALIDATE("Global Dimension 1 Code", '');
                    END;
                    IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 2 Code" THEN BEGIN
                        VALIDATE("Global Dimension 2 Code", '');
                    END;
                END;
            END
            ELSE BEGIN
                IF (Code <> '') THEN BEGIN
                    DefaultDimension_lRec.RESET();
                    DefaultDimension_lRec.SETRANGE("Table ID", DATABASE::"Salesperson/Purchaser");
                    DefaultDimension_lRec.SETRANGE("No.", Code);
                    DefaultDimension_lRec.SETRANGE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code");
                    IF DefaultDimension_lRec.FIND('-') THEN BEGIN
                        DefaultDimension_lRec.VALIDATE("Dimension Value Code", Code);
                        DefaultDimension_lRec.MODIFY(TRUE);
                    END
                    ELSE BEGIN
                        DefaultDimension_lRec.INIT();
                        DefaultDimension_lRec.VALIDATE("Table ID", DATABASE::"Salesperson/Purchaser");
                        DefaultDimension_lRec.VALIDATE("No.", Code);
                        DefaultDimension_lRec.VALIDATE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code");
                        DefaultDimension_lRec.VALIDATE("Dimension Value Code", Code);
                        DefaultDimension_lRec.INSERT(TRUE);
                    END;
                END
                ELSE BEGIN
                    DefaultDimension_lRec.RESET();
                    DefaultDimension_lRec.SETRANGE("Table ID", DATABASE::"Salesperson/Purchaser");
                    DefaultDimension_lRec.SETRANGE("No.", Code);
                    DefaultDimension_lRec.SETRANGE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code");
                    IF DefaultDimension_lRec.FIND('-') THEN BEGIN
                        DefaultDimension_lRec.DELETE(TRUE);
                    END;
                END;
            END;
        end;
    end;
}

Customer API Query:

query 55200 SWCSV00Customers
{
    QueryType = API;
    APIPublisher = 'thatGuy';
    APIGroup = 'smartConnectQueries';
    APIVersion = 'v1.0';
    EntityName = 'customerQuery';
    EntitySetName = 'customerQuery';

    elements
    {
        dataitem(Customer; Customer)
        {
            column(no; "No.")
            {
            }
            column(name; Name)
            {
            }
            column(email; "E-Mail")
            {
            }
            column(phoneNo; "Phone No.")
            {
            }
            column(address; Address)
            {
            }
            column(address2; "Address 2")
            {
            }
            column(city; City)
            {
            }
            column(county; County)
            {
            }
            column(postCode; "Post Code")
            {
            }
            column(countryRegionCode; "Country/Region Code")
            {
            }
            column(responsibilityCenter; "Responsibility Center")
            {
            }
            column(customerPostingGroup; "Customer Posting Group")
            {
            }
            column(genBusPostingGroup; "Gen. Bus. Posting Group")
            {
            }
            column(customerPriceGroup; "Customer Price Group")
            {
            }
            column(salespersonCode; "Salesperson Code")
            {
            }
            column(documentSendingProfile; "Document Sending Profile")
            {
            }
            column(contact; Contact)
            {
            }
            column(primaryContactNo; "Primary Contact No.")
            {
            }
            column(contactID; "Contact ID")
            {
            }
            column(contactType; "Contact Type")
            {
            }
            column(faxNo; "Fax No.")
            {
            }
            column(homePage; "Home Page")
            {
            }
            column(taxIdentificationType; "Tax Identification Type")
            {
            }
            column(taxExemptionNo; "Tax Exemption No.")
            {
            }
            column(vatRegistrationNo; "VAT Registration No.")
            {
            }
            column(allowLineDisc; "Allow Line Disc.")
            {
            }
            column(applicationMethod; "Application Method")
            {
            }
            column(paymentTermsCode; "Payment Terms Code")
            {
            }
            column(paymentMethodCode; "Payment Method Code")
            {
            }
            column(shipmentMethodCode; "Shipment Method Code")
            {
            }
            column(shippingAgentCode; "Shipping Agent Code")
            {
            }
            column(shippingAgentServiceCode; "Shipping Agent Service Code")
            {
            }
            column(shippingAdvice; "Shipping Advice")
            {
            }
            column(reserve; Reserve)
            {
            }
            column(swcSVSalesForceID; "SWC-SV SalesForce ID")
            {
            }
            column(swcSVShopifyAddressID; "SWC-SV Shopify Address ID")
            {
            }
            column(swcSVShopifyID; "SWC-SV Shopify ID")
            {
            }
            column(SWCSVSPSFOwnerID; "SWC-SV SP SF Owner ID")
            {
            }
            column(SWCSVCreatedBy; "SWC-SV Created By")
            {
            }
            column(swcSVCreatedDateTime; "SWC-SV Created DateTime")
            {
            }
            column(swcSVCustomerClass; "SWC-SV Customer Class")
            {
            }
            column(swcSVModifiedBy; "SWC-SV Modified By")
            {
            }
            column(swcSVModifiedDate; "SWC-SV Modified Date")
            {
            }
            column(swcSVModifiedDateTime; "SWC-SV Modified DateTime")
            {
            }
            column(swcSVModifiedonBehalf; "SWC-SV Modified on Behalf")
            {
            }
            column(swcSVSetTerritoryDim; "SWC-SV Set Territory Dim.")
            {
            }
            column(swcSVApplyTemplate; "SWC-SV Apply Template")
            {
            }
            column(swcSVShopifyActivURLDate; "SWC-SV Shopify Activ URL Date")
            {
            }
            column(swcSVShopifyActivURL; "SWC-SV Shopify Activ URL")
            {
            }
            column(swcSVShopifyInviteDate; "SWC-SV Shopify Invite Date")
            {
            }
            column(swcSVShopifyInvite; "SWC-SV Shopify Invite")
            {
            }
            column(swcSVShopifyPreventSync; "SWC-SV Shopify Prevent Sync")
            {
            }
            column(swcSVSalesForcePreventSync; "SWC-SV SalesForce Prevent Sync")
            {
            }
            column(swcSVShopifyUserEmail; "SWC-SV Shopify User Email")
            {
            }
            column(swcSVZendeskID; "SWC-SV Zendesk ID")
            {
            }
        }
    }
}


Version: Platform 14.0.37493.0 + Application 37541 (US Business Central 14.5)

Error Information:

Error TextThe supplied field number '55217' cannot be found in the 'Customer' table.

Error Code: FieldNotFound:TargetInvocation
Error Call Stack:
DotNet_NavAppALInstaller(CodeUnit 3016).ALInstallNavApp line 2
NavExtensionInstallationMgmt(CodeUnit 2500).InstallNavExtension line 2
"Extension Details"(Page 2501)."Install - OnAction"(Trigger) line 15
Error Object:
Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLFieldNotFoundException: The supplied field number '55217' cannot be found in the 'Customer' table. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLFieldNotFoundException: The supplied field number '55217' cannot be found in the 'Customer' table.
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaTable.GetFieldByNo(Int32 fieldNo, Boolean trapError) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaTable.cs:line 1307
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.CreateSubQueryForFlowFieldCalculation(NCLMetaQueryDataItem baseDataItem, MetaQueryColumn flowFieldColumn, Int32 nextColumnId) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaQuery.cs:line 0
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.CreateDataItemsFromDesignMetadata(NCLMetaQueryDefinition parentQueryDefinition, MetaQuery metaQuery, Boolean allowExpressionEvaluation, Boolean& tableFilterHasVariables) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaQuery.cs:line 462
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.<>c__DisplayClass68_1.<ParseMetadata>b__0(NCLMetaQueryDefinition queryDefinitionBeingCreated) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaQuery.cs:line 481
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaQueryDefinition..ctor(NCLMetaQueryDataItem parentDataItem, Int32 topRows, Func`2 dataItemsCreator, Func`2 orderBysCreator) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaQueryDefinition.cs:line 73
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.ParseMetadata(MetaQuery metaQuery, Boolean allowExpressionEvaluation) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaQuery.cs:line 476
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.LoadMetadata() in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaQuery.cs:line 201
   at Microsoft.Dynamics.Nav.Runtime.NCLMetaApplicationObject.Populate() in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetaApplicationObject.cs:line 200
   at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.GetMetaApplicationObjectInternal(ApplicationObjectId appObjectId, Boolean requireCompiled, Boolean onlySearchCache, Int32 appGroupId) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetadata.cs:line 1296
   at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.GetMetaApplicationObject(ApplicationObjectId appObjectId, Int32 appGroupId, Boolean requireCompiled, Boolean onlySearchCache) in s:
repo
src
Platform
Server
Prod.Ncl
NCLMetadata
NCLMetadata.cs:line 1025
   at Microsoft.Dynamics.Nav.Runtime.ApiWebServiceEntryHelper.GetAllVersions(ObjectType objectType, Int32 objectId, PackageId packageId, NavAppGroup group, HashSet`1 paths, Boolean throwOnEndpointDuplicate) in s:
repo
src
Platform
Server
Prod.Ncl
WebServices
ApiWebServiceEntryHelper.cs:line 134
   at Microsoft.Dynamics.Nav.Runtime.ApiWebServiceEntryHelper.GetEntriesFromNavApp(NavAppGroup group, HashSet`1 paths) in s:
repo
src
Platform
Server
Prod.Ncl
WebServices
ApiWebServiceEntryHelper.cs:line 62
   at Microsoft.Dynamics.Nav.Runtime.WebServiceHelper.GetApiWebServices(NavAppGroup group) in s:
repo
src
Platform
Server
Prod.Ncl
WebServices
WebServiceHelper_Api.cs:line 86
   at Microsoft.Dynamics.Nav.Service.Api.ApiRouteManager.ConfigureRoutes(NavAppGroup group) in s:
repo
src
Platform
Server
Prod.Service.Api
Hosts
ApiRouteManager.cs:line 158
   at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppGroupUpdater.ConfigureRoutes(NavAppGroup group) in s:
repo
src
Platform
Server
Prod.Ncl
Apps
NavAppGroupUpdater.cs:line 134
   at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppGroupUpdater.PrepareAppGroup(NavAppGroup group) in s:
repo
src
Platform
Server
Prod.Ncl
Apps
NavAppGroupUpdater.cs:line 116
   at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppUpgradeInternalProcessor.InternalUpgradeNavApp(NavAppUpgradePrecheckResult precheckResult, String name, NavSession session, NavTenant tenant, String activityId, LanguageSetting language) in s:
repo
src
Platform
Server
Prod.Ncl
Apps
V2Upgrade
NavAppUpgradeInternalProcessor.cs:line 43
   at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppUpgrader.UpgradeNavApp(StartNavAppDataUpgradeArguments startNavAppDataUpgradeArguments) in s:
repo
src
Platform
Server
Prod.Ncl
Apps
V2Upgrade
NavAppUpgrader.cs:line 92
   at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppALInstaller.<>c__DisplayClass3_0.<ALInstallNavApp>b__0() in s:
repo
src
Platform
Server
Prod.Ncl
Apps
NavAppALInstaller.cs:line 151
   at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppDiagnosticSession.SendTraceTagOnFailure(Action operation, String additionalInfo, Func`2 exceptionMap, String callerName) in s:
repo
src
Platform
Server
Prod.Ncl
Apps
NavAppDiagnosticSession.cs:line 46
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dynamics.Nav.Runtime.NavDotNet.Invoke[T](String methodName, UInt32 methodIndex, BindingFlags flags, ParameterModifier modifier, Type[] referenceTypes, Object[] arguments) in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavDotNet.cs:line 1496
   at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeMethod[T](Boolean isStatic, String methodName, UInt32 methodIndex, Object[] arguments) in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavDotNet.cs:line 1272
   at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit3016.ALInstallNavApp_Scope.OnRun()
   at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavMethodScope.cs:line 456
   at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit3016.ALInstallNavApp(Guid packageID, Int32 lcid)
   at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit3016.OnInvoke(Int32 memberId, Object[] args)
   at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallNavExtension_Scope.OnRun()
   at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavMethodScope.cs:line 456
   at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallNavExtension(Guid packageID, Int32 lcid)
   at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.OnInvoke(Int32 memberId, Object[] args)
   at Microsoft.Dynamics.Nav.BusinessApplication.Page2501.Install_a45_OnAction_Scope.OnRun()
   at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavMethodScope.cs:line 456
   at Microsoft.Dynamics.Nav.BusinessApplication.Page2501.Install_a45_OnAction()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args, Boolean resolveHandler, Boolean throwOnNotFound) in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavApplicationMethod.cs:line 53
   --- End of inner exception stack trace ---
   at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args, Boolean resolveHandler, Boolean throwOnNotFound) in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavApplicationMethod.cs:line 104
   at Microsoft.Dynamics.Nav.Runtime.NavForm.RaiseOnAction(Nullable`1 actionId, String actionTriggerMethodName) in s:
repo
src
Platform
Server
Prod.Ncl
Runtime
NavForm.cs:line 820
   at Microsoft.Dynamics.Nav.Service.NSField.ActionField(NavSession con) in s:
repo
src
Platform
Server
Prod.Service
NSField.cs:line 415
   at Microsoft.Dynamics.Nav.Service.NSField.Action(NavSession session) in s:
repo
src
Platform
Server
Prod.Service
NSField.cs:line 366
   at SyncInvokeActionField(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.RunInTransactionCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) in s:
repo
src
Platform
Server
Prod.Service
ServiceOperationInvoker.cs:line 348
   at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) in s:
repo
src
Platform
Server
Prod.Service
ServiceOperationInvoker.cs:line 729
   at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.TransientErrorRetryCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) in s:
repo
src
Platform
Server
Prod.Service
ServiceOperationInvoker.cs:line 369
   at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) in s:
repo
src
Platform
Server
Prod.Service
ServiceOperationInvoker.cs:line 729
   at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) in s:
repo
src
Platform
Server
Prod.Service
ServiceOperationInvoker.cs:line 314
Thank you very much!
  • The issue has been identified! The field, SWC-SV SP SF Owner ID,  resolved correctly in BC, but it is a flow field; so, it doesn't get stored anywhere in SQL.

    Instead of pointing to a flow field, the following allows me to link the corresponding Salesforce Owner ID:

    dataitem(Salesperson_Purchaser; "Salesperson/Purchaser")
    {
        DataItemLink = Code = Customer."Salesperson Code";
        column(salesforceOwnerID; "SWC-SV SalesForce Owner ID")
        {
        
        }
    }

    A word of caution-- beware the Normal Query validation.  During my initial troubleshooting, I found that the Normal Query resolved without a problem, but the API query crashed whenever I tried to install the extension.  That was only half true.  VSCode and Extension installation succeeded, but the corresponding Query would crash BC every time I tried to search for it under Web Services.  Worse yet, the Customer page would crash due to the mismatched reference to the flow field.  I couldn't even get into tenant telemetry until the extension was uninstalled.

    Microsoft should apply the same extension installation validation on the Normal Query as the API Query; so, others don't make my same mistake  I would have liked to get an error in VSCode before I attempted to compile/deploy to sandbox.

Related
Recommended