Error: Failure while emitting method.

TallyHoTallyHo Member Posts: 416
Hi, I've created this xmlport (csv import) in BC17:

xmlport 50000 "Invoice Import"
{
Direction = Import;
Format = VariableText;
FieldDelimiter = '<None>';
FieldSeparator = ',';
TextEncoding = UTF8;

schema
{
textelement(Root)
{
tableelement(Integer; Integer)
{
UseTemporary = true;
textelement(Field1) { }
textelement(Field2) { }
textelement(Field3) { }
textelement(Field4) { }
textelement(Field5) { }
textelement(Field6) { }
textelement(Field7) { }
textelement(Field8) { }
textelement(Field9) { }
textelement(Field10) { }
trigger OnBeforeInsertRecord()
begin
counter += 1;
"Integer".Number := counter;

end;

trigger OnAfterInsertRecord()
begin
//do something
ImportedFile[1].Add(Field1);
ImportedFile[2].Add(Field2);
ImportedFile[3].Add(Field3);
ImportedFile[4].Add(Field4);
ImportedFile[5].Add(Field5);
ImportedFile[6].Add(Field6);
ImportedFile[7].Add(Field7);
ImportedFile[8].Add(Field8);
ImportedFile[9].Add(Field9);
ImportedFile[10].Add(Field10);
end;
}
}



}

procedure GetImportedFile(var VImportedFile: Array[10] of List of [Text])
begin
CopyArray(VImportedFile, ImportedFile, 1);

end;

var
counter: Integer;
ImportedFile: Array[10] of List of [Text];

}

The compiler in vs code has no problem with the use of an array of lists.
But as soon as I try compile the app as a file it leaves met with this:

Failure while emitting method. Object:'Codeunit ImportMgt' Method:'Import()'
Unexpected value 'List' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.NavTypeKind'
Failure while emitting method. Object:'XmlPort "Import"' Method:'GetImportedFile(var array[10] of List of [Text])'
Unexpected value 'List' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.NavTypeKind'
Sign In or Register to comment.