Use a Staging document to write data to or read data from the staging table.
You can use the staging table to validate data before you actually process it. For example, you can validate received data before you import it into D365 FO. You can do these validations automatically or manually, depending on the chosen handler. If the validations are:
  • Not met, the journal gets the status Rejected. The found errors or warnings are added to the journal. You can solve these data errors or warnings before further processing the data.
  • Met, the journal gets the status Approved and can be picked up for further processing.


Standard procedure

1. Click Connectivity studio Integration Design.
2. Click the Documents tab.
3. Click New.
4. Define a meaningful name for the document.
Example: If the document is used for a sales integration, you can use names like 'Sales - Order' or 'Sales - Invoice'.
  In the Document field, type a value.
 

Note: Best practice: In the document name, do not use the:
- Application: Use the Application field to define the applicable application.
- Document type: Use the Document type field to define the applicable document type.

5. In the Project field, enter or select a value.
6. Define the applicable application for the document. For a Staging document, for example, select a 'D365 FO' or 'Staging' application.
  In the Application field, enter or select a value.
 

Note: You can only select an application that is defined for the applicable project. You can define project applications on the Projects page.

7. In the Document types field, select 'Staging'.
8. Sub-task: Set Properties.
  8.1 Expand the Properties section.
  8.2 To improve performance when processing a lot of records, you can use paging. For paging, the records are split over several threads which run these records in parallel batch tasks.
Define the number of records to be processed by one batch task.
  In the Query page size field, enter a number.
 

Note: You can use this calculation to define the number to be entered: Query page size = Total number of records / Number of available threads.

  8.3 On export, if you start the message run manually, you can have the standard D365 FO query page shown before the message is run. You can use this query page to define more-detailed ranges.
  Select Yes in the Prompt field.
 

Note: If the message is run in batch, the standard D365 FO query page is not shown, and an error is logged.

  8.4 Define journal type of the staging journal. This is a self-definable name. Use the journal type to easily identify staging journals.
  In the Journal type field, type a value.
  8.5 Define the number sequence that is used to generate the journal ID.
  In the Number sequence field, enter or select a value.
  8.6 Define the staging journal table. You can select one of the predefined staging tables.
If you do not use EDI, use the predefined 'BisStagingBufferOrderJournal' table.
If you have set up a custom staging table in the right way, you can select it here as well.
  In the Journal table field, enter or select a value.
 

Note: If you use the predefined 'BisStagingBufferOrderJournal' table, on the Lines view, in the Records section, enter the 'BisStagingBufferTable' as record table. You define the record relations with the Parent record field. So, do not define relations on the Relations tab.

  8.7 If you have selected the 'BisEdiStagingInventoryOrder' table, you can also select the relevant EDI message type. This is for informational purposes only.
  In the Inventory document flow field, select an option.
  8.8 On creation of an EDI staging journal, when line validations are not met, the staging journal can be split into two staging journals. If the staging journal is split, separate staging journals are created with the:
- Approved lines. So, these lines can be processed further.
- Rejected lines.
You can only split a staging journal if the journal table of the document is one of these EDI staging tables:
- BisEdiStagingTransferOrder
- BisEdiStagingPurchOrder
- BisEdiStagingSalesOrder
- BisEdiDelforStagingJournal
- BisEdiStagingInventoryOrder
  Select Yes in the Split on error field.
 

Note: If 'Split on error' is 'Yes', also define the 'Split percentage'.

  8.9 Define the maximum percentage of rejected lines for which a staging journal can be split. Define a percentage between 0 and 100.
  In the Split percentage field, enter a number.
 

Note: If the percentage of rejected lines is higher than the 'split percentage', the staging journal is not split. So, only one staging journal is created with the journal status 'Rejected'.

9. Sub-task: Set (custom) handler.
  9.1 Expand the Custom section.
  9.2 For a Staging document, these standard handler classes are available:
- BisDocumentStaging: This handler class writes data to or reads data from the staging table. On write, the written staging table record is automatically approved. On approval, the data validations are done. On read, only the journals with journal status 'Approved' and message status 'To be processed' are read.
- BisStagingDocumentManualApproval: This handler class writes data to or reads data from the staging table. On write, the data is only written to the staging table. You must manually approve the journals. On approval, the data validations are done. On read, only the journals with journal status 'Approved' and message status 'To be processed' are read.
You can use a customized handler class. To do so, extend a standard handler class.
  In the Handler field, enter or select the desired handler class.
 

Note: If you use EDI, you can also use this handler class: BisEdiDocumentStagingChangeCompany. This handler class imports data into the staging table. On import, it switches to the company as defined in the EDI history and imports the data into that company.

10. Close the page.

See also

Provide feedback