Hello all,
I'm trying to register an UDO from a XML file, and I keep getting the -1114 error.
I'm using the following code:
Note: when debugging, the error occurs in
oCompany.GetBusinessObjectFromXML(sXmlFileName, iCounter)
statement, which return Nothing. I checked the sXmlFileName and iCounter and they hold the correct values.
Case BoObjectTypes.oUserObjectsMD Dim oUDO As SAPbobsCOM.UserObjectsMD = oCompany.GetBusinessObjectFromXML(sXmlFileName, iCounter) Try BarraDeProgresso.Value += 1 BarraDeProgresso.Text = "UDO: " & oUDO.Code & "(" & oUDO.Name & ")" If oUDO.Add <> 0 Then oApplication.MessageBox("AddUDO Error: " & oCompany.GetLastErrorCode.ToString & " >> " & _ oCompany.GetLastErrorDescription & vbCrLf & "Elemento: " & iCounter) Exit Function End If Catch ex As Exception oApplication.MessageBox("UDO Error: " & Err.Number & ", " & Err.Description) Finally System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDO) oUDO = Nothing GC.Collect() End Try
And my XML file looks like these:
<?xml version="1.0" encoding="UTF-16"?> <BOM> <BO> <AdmInfo> <Object>206</Object> </AdmInfo> <OUDO> <row> <Code>ADAT_O01</Code> <Name>Nota de Recepção</Name> <TableName>ADAT_001</TableName> <TYPE>3</TYPE> <MngSeries>Y</MngSeries> <CanDelete>N</CanDelete> <CanClose>Y</CanClose> <CanCancel>Y</CanCancel> <CanFind>Y</CanFind> <CanYrTrnsf>N</CanYrTrnsf> <CanDefForm>N</CanDefForm> <CanLog>Y</CanLog> <OvrWrtDll>N</OvrWrtDll> </row> </OUDO> <UDO1> <row> <TableName>ADAT_002</TableName> </row> </UDO1> <UDO2> <row> <ColAlias>U_ADAT_001</ColAlias> <ColumnDesc>Código do Fornecedor</ColumnDesc> </row> <row> <ColAlias>U_ADAT_002</ColAlias> <ColumnDesc>Nome do Fornecedor</ColumnDesc> </row> <row> <ColAlias>U_ADAT_003</ColAlias> <ColumnDesc>Pessoa de Contacto</ColumnDesc> </row> <row> <ColAlias>U_ADAT_004</ColAlias> <ColumnDesc>Nº Ref. Fornecedor</ColumnDesc> </row> <row> <ColAlias>U_ADAT_005</ColAlias> <ColumnDesc>ID do Parcelário</ColumnDesc> </row> <row> <ColAlias>U_ADAT_006</ColAlias> <ColumnDesc>Nome do Parcelário</ColumnDesc> </row> <row> <ColAlias>U_ADAT_007</ColAlias> <ColumnDesc>Folha</ColumnDesc> </row> <row> <ColAlias>U_ADAT_008</ColAlias> <ColumnDesc>Código da Variedade</ColumnDesc> </row> <row> <ColAlias>U_ADAT_009</ColAlias> <ColumnDesc>Nome da Variedade</ColumnDesc> </row> <row> <ColAlias>U_ADAT_011</ColAlias> <ColumnDesc>Data de Recepção</ColumnDesc> </row> <row> <ColAlias>U_ADAT_024</ColAlias> <ColumnDesc>Observações do Documento</ColumnDesc> </row> </UDO2> <UDO3> </UDO3> </BO> </BOM>
The error message is:
<ErrorList><Error>System Id = 75047768, Line Number = 1, Column Number = 79, Description = The namespace of element 'schema' must be from the schema namespace.</Error> <Error>System Id = 75047768, Line Number = 1, Column Number = 99, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 75047768, Line Number = 1, Column Number = 112, Description = The namespace of element 'complexType' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 117, Description = The namespace of element 'all' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 164, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 177, Description = The namespace of element 'complexType' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 187, Description = The namespace of element 'sequence' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 239, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 252, Description = The namespace of element 'complexType' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 257, Description = The namespace of element 'all' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 321, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 407, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 420, Description = The namespace of element 'complexType' must be from the schema .... .... .... <Error>System Id = 75048960, Line Number = 1, Column Number = 2590, Description = The namespace of element 'all' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 2654, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 2722, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 75048960, Line Number = 1, Column Number = 2789, Description = The namespace of element 'element' must be from the schema namespace.</Error> <Error>System Id = 74433152, Line Number = 10, Column Number = 11, Description = Unknown element 'TYPE'</Error> <Error>System Id = 74433152, Line Number = 20, Column Number = 10, Description = Element 'TYPE' is not valid for content model: 'All(Code,Name,TableName,LogTable,MngSeries,CanDelete,CanClose,CanCancel,ExtName,CanFind,CanYrTrnsf,CanDefForm,CanLog,OvrWrtDll,UIDFormat)'</Error></ErrorList>
Thanks in advanced,
Vítor Vieira