AL icon indicating copy to clipboard operation
AL copied to clipboard

Problem create Table with TableType=ExternalSQL

Open geraldbeaulieu877 opened this issue 8 years ago • 5 comments

In this sample, I want to create a Table Navision named "My Navision Table" linking on an external SQL table named "My SQL Table". But the Extension installation create "My SQL Table" in SQL Navision database rather "My Navision Table"

PS; I set my app.jason to "target": "Internal"

table 50200 "My Navision Table" {

TableType= ExternalSQL;
ExternalName= 'My SQL Table';
ExternalSchema= 'dbo';

fields
{
    field(1;Type;Integer)
    {             
    }

    field(2;"Name";Text[30])
    {
    }
}

keys
{
    key(Key1;Type)
    {
        Clustered = true;
    }
}

}

geraldbeaulieu877 avatar Dec 26 '17 08:12 geraldbeaulieu877

Anybody as an answer?

geraldbeaulieu877 avatar Jan 18 '18 05:01 geraldbeaulieu877

Hi @geraldbeaulieu877 . According to the docs, https://msdn.microsoft.com/en-us/library/dn951479(v=nav.90).aspx , the ExternalName property specifies the name of the table in the database. Isn't this expected as in your scenario?

doivosevic avatar Jan 23 '18 11:01 doivosevic

HI @DominikDitoIvosevic , look the following demo table code, It's link on the Navision Object Table in my Navision Demo Database, but I have this error message DEBUGCONSOLE on compiling

[2018-01-23 13:21:55.20] Sending request to http://localhost:18049/dynamicsnav110/dev/apps [2018-01-23 13:22:04.62] The request for path /dynamicsnav110/dev/apps failed with code 422. Reason: The following SQL error was unexpected: There is already an object named 'Object' in the database.

I suppose the compiler try to create the table Object.

table 50203 "Dev Object" {
TableType= ExternalSQL; ExternalName= 'Object'; ExternalSchema= 'dbo';

fields
{
    field(1;Type;Option)
    {
         CaptionML = ENU='Object Status',
                    FRC='Status de l''objet',
                    ENC='Object Status';
        Editable = false;
        OptionCaptionML = ENU=' ,Table,,Report,,Codeunit,XMLport,MenuSuite,Page,Query',
                        FRC=' ,Table,,Rapport,,Codeunit,XMLPort,MenuSuite,Page,Requête',
                        ENC=' ,Table,,Report,,Codeunit,XMLport,MenuSuite,Page,Query';
        OptionMembers = " ","Table",,"Report",,"Codeunit","XMLport","MenuSuite","Page","Query";
    }

    field(2;"Company Name";Text[30])
    {
    }
    field(3;ID;Integer)
    {
    }
    field(4;Name;Text[30])
    {
    }
    field(5;Modified;Boolean)
    {
    }
    field(6;Compiled;Boolean)
    {
    }
    field(7;"BLOB Reference";Blob)
    {
    }
    field(8;"BLOB Size";Integer)
    {
    }
    field(9;"DBM Table No.";Integer)
    {
    }
    field(10;"Date";Date)
    {
    }
    field(11;"Time";Time)
    {
    }
    field(12;"Version List";Text[248])
    {
    }
    field(13;Locked;Boolean)
    {
    }
    field(14;"Locked By";Text[132])
    {
    }
}

keys
{
    key(PK;Type,"Company Name",ID)
    {
        Clustered = true;
    }
 }
}

geraldbeaulieu877 avatar Jan 23 '18 18:01 geraldbeaulieu877

Thank you for the clear repro. I will pass on the bug to the appropriate team

doivosevic avatar Jan 25 '18 13:01 doivosevic

This is going to be fixed soon. Tables with a type other than Normal should not factor in to the schema sync process.

cmrudolph-msft avatar Feb 02 '18 02:02 cmrudolph-msft