XML

This section describes XML.

In Visma Business, you can run EDI as an XML message. This will be controlled in the Bedriftsopplysninger table under EDI-behandling field.

XML format in output file and XML format in input file

In this dialog box you can define whether the EDI files are to be created in XML format or in normal, semicolon-separated EDI format.

XML-compatible format

During import an XML tag must consist of a table name and field name (SQL). Previously the separator between table name and field name was a full stop (.). In XML format it is not permitted to have a full stop (.) as SQL syntax. It has therefore been replaced with an underscore (_). It is also not permitted to use numbers that Visma Business uses for individual "External IDs". If there is only an "External ID", the tag must start with _NNNN, in which NNNN represents the "External ID". You must select the XML compliant format field to interpret the new value.

Merk: If the <ORDERS> tag in the import file includes which format is in the import file, you do not need to select the XML compliant format field.

The formats are:

This means that if the import file contains <ORDERS format_xml="2.0"> you do not need to select the XML compliant format field. Visma Business then understands that an underscore has been used rather than a full stop.

When you set this option, you must also update in the EDI messages table.

You must register an imp template for the various message types. The imp files which will be used as a template for EDI can also be used as a template for XML. You customise in accordance with other documentation.

The format which the out file is created in is:

<?xml version=1.0 encoding=windows-1252?>
<INVOIC>
 <OrderHead> </OrderHead>
 <OrderLine> </OrderLine>
 <OrderLine> </OrderLine>
</INVOIC>

There can be one or more OrderLine for an order.

Example of a field in an order head:
<Ord.Ad1>Box 121</Ord.Ad1>
<Ord.Ad2>Storgaten 3</Ord.Ad2>
<Ord.InvoCustNm>Sykkelmagasinet AS</Ord.InvoCustNm>

You can control the description of the <tag> by changing the description of the Function in the c record in position 7. If you are going to import the file into Visma Business again, only known tags that have fields in the Ordre or Ordrelinje tables are processed. During import not all special tags created for EDI can be used. During import the rules file is not read, but all order head tags are imported and validated. The order lines are then imported and validated. Invalid tags are not imported. Nor can there be any sub segments in the file. The import must have a start tag <OrderHead> Order head data and an end tag </OrderHead>, and the order lines must have a start tag <OrderLine> order line data and an end tag </OrderLine> for each order line.

The program puts a kind of tag around the whole order, depending on the type of order document being printed <ORDERS>, <INVOIC>,<ORDESP>

Example
a,1,;,1,,,,,1,,,,,,,,,,,,,,,,,,,,,
b,OrderHead,1,,1, c,RecType,1,1,0,,,,,,,,,S,
c,Ord.CustNo,4,40,0,,CustomerNo,,,,,,,S,
c,Ord.InvoNo,5,40,0,,InvoiceNo,,,,,,,S,
c,Ord.DueDt,7,40,0,,DueDate,,,,,,,S,
c,Ord.Nm,8,40,0,,Name,,,,,,,S,a,
c,Ord.Ad1,9,40,0,,Ad1,,,,,,,S,
c,Ord.Ad2,10,40,0,,Ad2,,,,,,,S,
c,Ord.PNo,13,40,0,,,,,,,,,S,
c,Ord.PArea,14,40,0,,Ord.,,,,,,,S,
b,OrderLines,1,,1, c,RecType,1,1,0,,,,,,,,,S,
c,OrdLn.LnNo,2,40,0,,OrdLn.LnNo,,,,,,,S,
c,OrdLn.ProdNo,3,40,0,,OrdLn.ProdNo,,,,,,,S,
c,OrdLn.Descr,4,40,0,,OrdLn.Descr,,,,,,,S,
c,OrdLn.NoInvoAb,7,40,0,,OrdLn.NoInvoAb,,,,,,,S,
c,OrdLn.Price,8,13,2,,OrdLn.Price,,,,,,,F,
On import, only the current ORDERSR will be imported in the XML format. The following is an example for creating orders:
<?xml version=1.0 encoding=windows-1252?>
<ORDERS>
 <OrderHead>
   <Ord.CustNo>100000</Ord.CustNo>
 </OrderHead>
 <OrderLine>
   <OrdLn.ProdNo>111</OrdLn.ProdNo>
   <OrdLn.NoInvoAb>10</OrdLn.NoInvoAb>
 </OrderLine>
 <OrderLine>
   <OrdLn.ProdNo>112</OrdLn.ProdNo>
   <OrdLn.NoInvoAb>5</OrdLn. NoInvoAb>
 </OrderLine>
</ORDERS>
Merk: With this method you can use the tag name that corresponds to the fields in the Ordre and Ordrelinje tables, and this only applies to the fields you use for normal registration. The special parameters that you use with standard EDI imports with H and L lines do not apply when you use this import method.


Vi setter pris på dine tilbakemeldinger. Send tilbakemelding til Visma på dette emnet.