Extend the solution

This article explains how the solution can be extended. The article covers different scenarios.

How to change the mapping of a field

If a user wants a value in an XML file to be inserted into a different field in the CEDO Received Document Header or CEDO Received Document Lines table then the CEDO XML version table must be changed. This can be done in the following steps:

  1. Choose the Søg efter side eller rapport icon, enter XML Version, and then choose the related link.
  2. On the XML version page, choose the action of the UBL-format and document type you want to change. This will filter the view to the relevant records.
  3. Identify the element to change by looking in the Tag Name field.
  4. In the Field – Import field activate the table relation and choose a field to map to.
  5. Choose the OK button. A dialog appears asking you to confirm the element is changed.
  6. Choose the Yes button.

How to add fields to the mapping

If an XML file contains an element that is not handled by the import, then this can be added.

  1. Choose the Søg efter side eller rapport icon, enter XML Version, and then choose the related link.

  2. On the XML version page, choose the action of the UBL-format and document type you want to change. This will filter the view to the relevant records.

  3. Identify where the new tag must be inserted. The placement must follow the placement in the XML structure in accordance to the already existing tags.

  4. Insert a new line.

  5. In the Tag Type field leave blank if the new element is an element in the XML without a parent tag.

  6. In the Data Type field, choose the appropriate datatype.

  7. In the Level field enter an integer value. Enter 0 for root level. Add 1 for each level the element has from the root element.

  8. In the Tag Name field enter the name of the element.

  9. In the **Data in processing **field choose Field.

  10. In the Table - Import field enter the id of the destination table or activate the table relation. A dialog appears asking you to confirm the element is changed.

  11. Choose the Yes button.

  12. To apply the change to the already imported documents choose the Søg efter side eller rapport icon, enter Receive, and then choose the related link.

  13. On the Number FastTab, choose the relevant document type. The Document Journal page now opens showing the electronic documents.

  14. On the Document Journal page, choose the document to you want to apply the changes to, then choose the Reload action.​

How to make a special handling of a new field

In some cases, the mapping of an element in the XML file to a field in Microsoft Dynamics NAV or Microsoft Dynamics 365 Business Central on premises is not enough. Sometimes a value from an XML element cannot be used directly and must have a special handling through code.

  1. Choose the Søg efter side eller rapport icon, enter XML Version, and then choose the related link.

  2. On the XML version page, choose the action of the UBL-format and document type you want to change. This will filter the view to the relevant records.

  3. In the XML Version page, copy the value of the Parent tag Chain field.

  4. Go to the CEDO Receive Document (6014353) codeunit.

  5. Go to the GetSpecialOIOUBL function.

  6. In the case statement insert the value from step 1 (the parent tag chain) as a case.

  7. Use the GetDataOneLine function from the XMLDataFile table to get the value of that line from the XML file.

    XMLDataFile.GetDataOneLine(XMLFile."Line No.",FALSE). The function returns a text value. Create a variable to hold the value.

  8. Now in the case statement from step 6, write the special handling code and assign the value to a field.

  9. Save the codeunit. A dialog appears asking you to confirm saving the codeunit.

  10. Choose the Yes button.

  11. To apply the change to the already imported documents choose the Søg efter side eller rapport icon, enter Receive, and then choose the related link.

  12. On the Number FastTab, choose the relevant document type. The Document Journal page now opens showing the electronic documents.

  13. On the Document Journal page, choose the document to you want to apply the changes to, then choose the Reload action.

How to add a field as a comment

Some of the elements in an XML file might be mapped into a field in a table. The information however might still be relevant to access. This can be done by setting up that the data must be placed as a comment instead.

  1. Choose the Søg efter side eller rapport icon, enter XML Version, and then choose the related link.

  2. On the XML version page, choose the action of the UBL-format and document type you want to change. This will filter the view to the relevant records.

  3. Identify where the new tag must be inserted. The placement must follow the placement in the XML structure in accordance to the already existing tags.

  4. Insert a new line.

  5. In the Tag Type field leave blank if the new element is an element in the XML without a parent tag.

  6. In the Data Type field, choose the appropriate datatype.

  7. In the Level field enter an integer value.

    Enter 0 for root level. Add 1 for each level the element has from the root element.

  8. In the Tag Name field enter the name of the element.

  9. In the Data in processing field, choose Special.

  10. In the Special handling code Import field, enter COMMENT. A dialog appears asking you to confirm the element is changed.

  11. Choose the Yes button.

  12. To apply the change to the already imported documents choose the Søg efter side eller rapport icon, enter Receive, and then choose the related link.

  13. On the Number FastTab, choose the relevant document type. The Document Journal page now opens showing the electronic documents.

  14. On the Document Journal page, choose the document to you want to apply the changes to, then choose the Reload action.